Skip to content

Instantly share code, notes, and snippets.

@geoffrepoli
Last active October 26, 2021 23:45
Show Gist options
  • Save geoffrepoli/6aeeaec78cca07f00e8c5fe12064e67f to your computer and use it in GitHub Desktop.
Save geoffrepoli/6aeeaec78cca07f00e8c5fe12064e67f to your computer and use it in GitHub Desktop.
creates formatted logfile of all third-party launch agents, daemons, kernel extensions, login items, and library extensions. user must be admin to run, you will be prompted for a password
sh -c 'echo "===> Launch Daemons <==="; sudo launchctl list | sed 1d | awk '"'"'!/0x|com.apple/{print $3}'"'"' | grep -Ev '"'"'(cups|ntp|ssh|cron)'"'"'; \
echo "\n===> Launch Agents <==="; launchctl list | sed 1d | awk '"'"'!/0x|com.apple/{print $3}'"'"'; \
echo "\n===> Kernel Extensions <==="; kextstat -kl | awk '"'"'!/com.apple/{print $6}'"'"'; \
[ -f $HOME/Li*/Preferences/com.apple.loginitems.plist ] && { echo "\n===> Login Items <==="; /usr/libexec/PlistBuddy -c "Print :SessionItems:CustomListItems" $HOME/Library/Preferences/com.apple.loginitems.plist | awk -F'"'"'= '"'"' '"'"'/Name/{print $NF}'"'"'; }; \
echo "\n===> Privileged Helper Tools <==="; ls -1A /Li*/PrivilegedHelperTools; \
echo "\n===> PreferencePanes <==="; ls -1A /Li*/PreferencePanes; \
echo "\n===> Internet Plug-Ins <==="; ls -1A /Li*/Internet\ Plug-Ins | grep -v Disabled; \
echo "\n===> Total Loaded Fonts <==="; echo $(( $(wc -l <<< "$(ls -1A /Li*/Fonts)" | tr -d '"'"' '"'"') + $(wc -l <<< "$(ls -1A $HOME/Li*/Fonts)" | tr -d '"'"' '"'"') )) 2>/dev/null' \
>/private/tmp/services-"$(date -j "+%Y-%m-%d__%H-%M-%S")".txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment