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



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

  1. Paul Archer says:

    Many, many thanks. Very useful to know

  2. sgscott says:

    Great app. Thank you very much.

    Scotty

  3. JP says:

    Great post man!! Many thanks!!

  4. Drillsetc says:

    Thanks for the excellent post. It was just what I was looking for.

  5. Rameshwar says:

    I got it what i want.
    Thanks.

  6. kenny says:

    Very helpful, thanks!

  7. Chriskemm says:

    Cheers!

  8. vol7ron says:

    Many years later, new to OS X, thanks for showing this. I have a feeling I’m going to forget too (especially if I need to do it on a fresh install or someone else’s machine) so I’m going to make a “OSX tweaks” folder.

  9. Ty says:

    That little toggle app is awesome, just what I was hoping to find. Thanks!

  10. kRemtronicz says:

    Awesome: just what I needed. New to Mac; learning new stuff. ;O)

  11. stereoform says:

    hi,

    i tried automator application but unfortunately don’t know how to hide hidden folders again. :(

  12. Travis says:

    Thanks a million for this post. New to Mac’s and more than a little miffed to be honest

  13. hunksomestranger says:

    That was very helpful! I was neophyte in MAC OS X and I don’t know much of it. Thanks for this, I truly appreciate it.

  14. Also, you can adjust visibility of individual files with:
    chflags nohidden filenamehere
    or for all the files, recursively, in the current directory:
    chflags -R nohidden *

  15. ratih says:

    Danke!

  16. Dan T says:

    Thank you! Usefull post!

  17. [...] Mac OS X – Show / Hide Hidden Files in Finder LD_AddCustomAttr("AdOpt", "1"); LD_AddCustomAttr("Origin", "other"); LD_AddCustomAttr("LangId", [...]

  18. [...] Mac OS X – Show / Hide Hidden Files in Finder LD_AddCustomAttr("AdOpt", "1"); LD_AddCustomAttr("Origin", "other"); LD_AddCustomAttr("LangId", [...]

  19. MacLover says:

    Hi,
    When I tried to hide,
    the terminal shows,
    ‘Could not write domain /Users/Library/Preferences/com.apple.finder.plist; exiting’

  20. Tino Cordes says:

    Thanks! I never seem to be able to remember what to write in Terminal :-)

  21. keith bierman says:

    Nice post, good to jog the memory. But trying your toggle script, it was misfiring, so adding some “echo” lines, I see that isVisible is printing ” ÓTRUEÓ” which never matches … is this a Mac misfeature I’ve forgotten or ??

    Thanks in advance!

  22. EmmaT says:

    Thank you!

Leave a Reply