Last active
August 29, 2015 14:25
-
-
Save zlargon/25cfc03a00c9a9225799 to your computer and use it in GitHub Desktop.
[MAC OSX] Show/Hide the hidden files in 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
# [MAC OSX] Show/Hide the hidden files in Finder. | |
# add this function to '~/.bash_profile' and reopen terminal. | |
# Usage: show-file -> show | |
# show-file 0 / off / hide / false -> hide | |
show-file () { | |
opt=$(echo $1 | tr '[:upper:]' '[:lower:]') # transfer into lowercase | |
# Hide Files | |
if [ "$opt" = "off" ] || [ "$opt" = "0" ] || [ "$opt" = "false" ] || [ "$opt" = "hide" ] ; then | |
echo "Hide all the hidden files in Finder." | |
defaults write com.apple.finder AppleShowAllFiles FALSE | |
killall Finder | |
return | |
fi | |
# Show all the Files | |
echo "Show all the hidden files in Finder." | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
killall Finder | |
echo "Use 'show-file off' to hide the hidden files in Finder." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment