Skip to content

Instantly share code, notes, and snippets.

@trsdln
Last active November 23, 2016 13:38
Show Gist options
  • Save trsdln/7838ecf5e439a930dc58ba2a72b41ac6 to your computer and use it in GitHub Desktop.
Save trsdln/7838ecf5e439a930dc58ba2a72b41ac6 to your computer and use it in GitHub Desktop.
Simple script that allows to find junk files after application removal on Mac OS X
#!/bin/bash
#
# Mac OS X Junk config files detection
#
# Usage:
# ./detect-configs.sh microsoft
#
# - detect Microsoft's config files
#
U_HOME=~
TARGET_DIRS=( \
"${U_HOME}/Library" \
"${U_HOME}/Library/LaunchAgents" \
${U_HOME}/Library/Application\ Support \
"${U_HOME}/Library/Preferences" \
"${U_HOME}/Library/Preferences/ByHost" \
"${U_HOME}/Library/Caches" \
"${U_HOME}/Library/Logs" \
"/private/var/db/receipts" \
"/Library" \
"/Library/LaunchDaemons" \
"/Library/LaunchAgents" \
"/Library/PrivilegedHelperTools" \
"/Library/Preferences" \
"/Library/Caches" \
"/Library/Logs"
)
echo "Looking for: \"$1\"? (Enter=continue,Ctrl+C=cancel)"
read -n1
for ((i = 0; i < ${#TARGET_DIRS[@]}; i++))
do
echo "Checking: ${TARGET_DIRS[$i]}"
ls -al "${TARGET_DIRS[$i]}" | grep -i $1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment