Mac OS X – Show / Hide Hidden Files in Finder

I always forget how to do this because I toggle this rather sporadically so I’m adding it to the public record.

To show hidden files in Finder pop open your terminal and type the text shown in the screen grab below.

To go back to hiding files we obviously just flip the AppleShowAllFiles flag to FALSE.

*Update*
As noted in the comments its nice to have the text available for easy copy and paste into your terminal.

Show:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Hide:

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

*Update 2*

You can use this script toggle between states:

# 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

You can also download an Automator application which will toggle hidden file visibility here:

http://www.brooksandrus.com/downloads/show_files.zip

175 thoughts on “Mac OS X – Show / Hide Hidden Files in Finder

  1. Brooks, thank you for your selfless deed of publishing such a wonderful gem of a tip.

    Please publish more..

    thanks

  2. Hi, thanks for the neat script.
    but toggle script doesn’t work for me…I copied and pasted:

    # 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

    Did I do it write?

  3. Never thought i’d say this but windows (at least the pre-metro ones) has way better file management than mac os… i mean why not have this in preferences???

    And why can’t i merge two folders of the same name…

    sigh

  4. One additional tip: Make an alias of the directory (in my case the Library) Now, I can access the Library by just clicking on the alias and don’t need to perform the Terminal gymnastics just to access an old preferences file on my former back up drive.

  5. Thank you Gray Dog, now I don’t have to worry about my kids getting their hands into files they shouldn’t and I don’t have to toggle back and forth.

  6. Awesome, was struggling with hidden files being visible all over the computer. So simple fix, thanks a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>