Quickly show/hide hidden files on mac

The most common way to show the hidden files and folders on a mac is via the terminal. Although it gets the job done, its a tedious process requiring me to:

  • Fire up the terminal
  • google the command to show hidden files
  • paste ‘defaults write com.apple.finder AppleShowAllFiles YES’
  • relaunch the finder

And once done with my job, i don’t want to keep seeing all the hidden system files everywhere so I need again:

  • fire up the terminal
  • google the command to hide hidden files
  • paste ‘defaults write com.apple.finder AppleShowAllFiles NO’
  • relaunch

Well all this makes me try and avoid the task whole together. Ideally it should be just one call to toggle the hidden mode state. I find the best way to to do this is have a workflow app. This app just checks and toggles the status of hidden files flag. As a bonus it relaunches the finder for you.

So in essence all you need to do is:

  • Hit command + space (to bring up spotlight)
  • type ‘sh’ or ‘sho’ or ‘show’ etc.
  • hit return

hidden_files

And when you are done, you just need to do the same again!

Here is a download link to this app/widget. 
(just make sure you put it in a location that spotlight can search, Applications folder will do nicely)

This is based on a apple script I  found on some online forum.

# 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

Advertisements

3 thoughts on “Quickly show/hide hidden files on mac

  1. Johnd488 says:

    I am impressed with this website, rattling I am a big fan. ecdaddadfkga

  2. iphonemacdev says:

    Thank you for all your source code & app goodies (especially, the ninja mode & show files)! I haven’t read through your other postings, but I will try to find some free time. I’m new to developing OS X & iOS, so your “short” .xcodeproj files will come in handy in teaching me how some things are done, at least I hope they will.

    The correct URL for your Show Files.zip should be:
    https://dl.dropboxusercontent.com/u/29449508/Software/Show%20Files.zip

    not the:
    https://dl.dropboxusercontent.com/u/29449508/Sotwares/Show%20Files.zip

    Thanks, again!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: