Skip to content

Instantly share code, notes, and snippets.

@NicholasModesto
Created July 24, 2013 23:09
Show Gist options
  • Save NicholasModesto/6075460 to your computer and use it in GitHub Desktop.
Save NicholasModesto/6075460 to your computer and use it in GitHub Desktop.
#Shell script that toggles hidden files on OSX
VAL=$(defaults read com.apple.finder AppleShowAllFiles);
if [ $VAL == 0 ]; then
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
killall Finder
osascript -e 'tell app "System Events" to display dialog "Now Showing Hidden Files."'
else
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
killall Finder
osascript -e 'tell app "System Events" to display dialog "Hidden Files Now Invisible."'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment