Skip to content

Instantly share code, notes, and snippets.

@bodja
Created April 23, 2015 08:56
Show Gist options
  • Save bodja/64d8a615e22e1338099d to your computer and use it in GitHub Desktop.
Save bodja/64d8a615e22e1338099d to your computer and use it in GitHub Desktop.
Show/hide files on mac os x
show () {
if [ $(defaults read com.apple.finder AppleShowAllFiles) == NO ]; then
SHOW=YES
else
SHOW=NO
fi
defaults write com.apple.finder AppleShowAllFiles $SHOW
kill -1 `ps aucx | grep Finder | awk '{print $2}'`
}
@bodja
Copy link
Author

bodja commented Apr 23, 2015

CREATE A SHORTCUT

  1. Open "Automator" app
    • crete New Document
    • choose "Service"
    • on the left side choose Utilities >> Run Shell Script
    • give the name to a script (e.g. ShowFiles)
    • paste shell script and save it
  2. Create shortcut
    • go to System Preferences >> Keyboard >> Shortcuts >> Services
    • scroll down, find script in the end
    • assign shortcut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment