Skip to content

Instantly share code, notes, and snippets.

@sony-mathew
Created February 20, 2018 18:23
Show Gist options
  • Save sony-mathew/364c2a093ae88c28dd31feb2e8e68fcb to your computer and use it in GitHub Desktop.
Save sony-mathew/364c2a093ae88c28dd31feb2e8e68fcb to your computer and use it in GitHub Desktop.
Script to show hidden files in mac
#!/bin/bash
# There are many folders and files which are by default hidden in mac like the .ssh folder, .bash_profile .. etc.
# In order for that to show up in your finder you can use this script.
#
# Download this script and give it the execute permission : $ chmod 764 show-hide-mac.sh
# Now click on the script. It will popup a terminal window with 3 options.
# 's' for show
# 'h' for hide
# 'e' for exit
#
# Once you select show or hide and exit and go to finder to see the hidden files.
# Author : Sony Mathew
# Date : 12 March 2017
echo "Show (s) or Hide (h) or Exit (e) Hidden Files in Finder?"
select yn in "s" "h" "e"; do
case $yn in
s ) defaults write com.apple.finder AppleShowAllFiles YES; echo "Shown";;
h ) defaults write com.apple.finder AppleShowAllFiles NO; echo "Hidden";;
e ) exit ;;
esac
killall Finder;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment