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



161 Responses to “ “Mac OS X – Show / Hide Hidden Files in Finder”

  1. Bill says:

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

    Please publish more..

    thanks

  2. Phil Doughty says:

    Thanks, handy time saver

  3. Helton Rosa says:

    Thank you for the Automator

  4. Laura says:

    Thanks :)

  5. Joshua says:

    Thanks..

  6. Andrew says:

    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?

  7. A3mercury says:

    Ty Ty

    super helpful ^^

  8. Ahsan says:

    Thanks a lot man …..

  9. 60Hz says:

    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

  10. Gray Dog says:

    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.

  11. prasad says:

    thankQ

Leave a Reply