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:
Many, many thanks. Very useful to know
Great app. Thank you very much.
Scotty
Great post man!! Many thanks!!
Thanks for the excellent post. It was just what I was looking for.
I got it what i want.
Thanks.
Very helpful, thanks!
Cheers!
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.
Thanks. =)
That little toggle app is awesome, just what I was hoping to find. Thanks!
Awesome: just what I needed. New to Mac; learning new stuff. ;O)
hi,
i tried automator application but unfortunately don’t know how to hide hidden folders again. :(
Thanks a million for this post. New to Mac’s and more than a little miffed to be honest
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.
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 *
Danke!
Thank you! Usefull post!
[...] Mac OS X – Show / Hide Hidden Files in Finder LD_AddCustomAttr("AdOpt", "1"); LD_AddCustomAttr("Origin", "other"); LD_AddCustomAttr("LangId", [...]
[...] Mac OS X – Show / Hide Hidden Files in Finder LD_AddCustomAttr("AdOpt", "1"); LD_AddCustomAttr("Origin", "other"); LD_AddCustomAttr("LangId", [...]
Hi,
When I tried to hide,
the terminal shows,
‘Could not write domain /Users/Library/Preferences/com.apple.finder.plist; exiting’
Thanks! I never seem to be able to remember what to write in Terminal :-)
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!
Thank you!
Thank you!!!!
Thanks. :)
Thank you for the automator script: I’d never remember that command line syntax!
thanks a lot.
After i install success Mac, my Partion is hidden. How to show ?
This is really helpful! thanks!! :)
Thank you so much… this was very helpful :)
[...] it seems hidden files are not shown in Mac OS X. This blog is really good as a reference: http://www.brooksandrus.com/blog/2007/03/23/mac-os-x-show-hide-hidden-files-in-finder/. I found this command is useful for me to show the hidden files in Mac OS [...]
Thank you!!!
Woow… Its nice commands.. thanks a ton…
The shell script given is either wrong or not working in my version of MacOS lion.
I edited the script and now it works for me… the edited script is as follows:
#!/bin/sh
# 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 = TRUE ]
then
defaults write com.apple.finder AppleShowAllFiles FALSE
else
defaults write com.apple.finder AppleShowAllFiles TRUE
fi
# force changes by restarting Finder
killall Finder
I changed the IF statement logic around for testing purposes. It does not really matter what order it is.
Thanks man! saved my day
Awesome! Thanks, dude!