Created
March 27, 2012 20:09
-
-
Save greylabel/2219829 to your computer and use it in GitHub Desktop.
Shell script to toggle visibility of .hidden in the Mac OS X Finder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# based on: http://www.brooksandrus.com/blog/2007/03/23/mac-os-x-show-hide-hidden-files-in-finder/ | |
# check if hidden files are visible and store result in a variable | |
isVisible="$(defaults read com.apple.finder AppleShowAllFiles)" | |
# toggle visibility based on variables value | |
if [ "$isVisible" = false ] | |
then | |
defaults write com.apple.finder AppleShowAllFiles true | |
else | |
defaults write com.apple.finder AppleShowAllFiles false | |
fi | |
# force changes by restarting Finder | |
killall Finder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment