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:
Thanks for the tip, I was trying to locate a hidden .cfg file for a particular application and I couldn’t use it anymore due to conflicting settings but that command line revealed the .cfg file so now I can manually change the settings, thanks!
Awesome! thanks.
Although it would have been much easier if there was a simple tick box in the finder preferences, like there is in windows explorer.
[...] to quickly access my .vimrc and other dot files using Finder. I found a couple of posts online (here and here) that described setting a property through the command line like [...]
This was the clearest, therefore the easiest instruction on how to get my system back to “normal”! I don’t even know why the .DS_Store files started showing up everywhere… but this really was so simple. Thanks a ton!
[...] the OSInstall file in the directory path specified. The terminal commands can be found here: Mac OS X – Show / Hide Hidden Files in Finder | Brooks Andrus I should get my 10V on Monday, so I'll try using EASEUS to shrink the existing XP partition, leave [...]
Thanks,
After following your instruction I was able to locate two +100Gb files generated by iMovie that filled my HardDisk [OSX Trash] and made impossible to operate with my computer.
Now I have recovered more than 200Gb space and my system is working fine!!!
Just wanted to say thanks. I too always switch this on and off. Thanks for showing me how to switch it this time around!
Awesome mate, cheers!
It was really helpful.Thanks!!!
Thanks!! It helped a lot. Now my mac is back to “normal”
Thanks for posting this easy to understand tip. It is much appreciated.
oooooooh tanks i could recover my files from the ipod because of this info. WWWWWWWOOOOOEPIE all is not lost.
thanks to on-line information sharing!!!!
it is great.
Thanks!
[...] forum thread here gives us some good optimism, and this blog post here tells us how to show .htaccess files on a mac (thanks for the nice hack, [...]
Thank you very much!!!
Thanks For sharing great tutorial !!
[...] This article was based on: http://www.brooksandrus.com/blog/2007/03/23/mac-os-x-show-hide-hidden-files-in-finder/ [...]
I used a program to show them and now i cant get rid of it and that didnt work :)
Wow dude thank you so much. Its about fucking time someone can give clear understanding directions about how to do something. SERIOUSLY thank you.
Thank you! I couldn’t figure out why my icons were too light in the applications folder. I also couldn’t figure out how to get rid of the .DS_Store folder that was showing up. This cleaned it all up!
By using this I was able to transfer songs directly from my iPod to my new MacBook, rather than having to deal with the tedious task of backing up my iTunes library to CDs or transferring songs via a jump drive. Thanks for the helpful info!
[...] ????Mac OS X – Show / Hide Hidden Files in Finder http://www.brooksandrus.com/blog/2007/03/23/mac-os-x-show-hide-hidden-files-in-finder/ [...]
Thank you! That helped a lot!
[...] Found this tip at: http://www.brooksandrus.com/blog/2007/03/23/mac-os-x-show-hide-hidden-files-in-finder/ [...]
you can use a keyboard shortcut which can be setup in System Preferences > keyboard
[...] was turning my entire home directory into a git repository. Don’t do that (to undo this show the hidden files in the finder and delete the .git directory). After recovering from that, I started out with a simple project and [...]
Congratulations for your tip. That’s simple command but help us a lot.
Hi,
Firstly – as everyone else says, thanks!
One comment – for me I had the change the script to play around with the quotes to make the if condition work correctly (OSX 10.5):
# 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
thank you very much. you don’t know what kind of help you did.. . if you not give me that code i lost some important document file.
If you want to hide some files on your Mac from curious eyes, then there is a solution available. It is called UberMask. It allows to hide/show files with a single keystroke. Available for test here: http://www.novamedia.de/en/mac-ubermask.html
Hi,
Very useful information :)
Thanks
Very useful, thanks!
you should add a Facebook Like button to this page.
thx for the help.
I need this all the time! Never can remember it. It is useful in finding files when people have installed spyware on your Mac. Can’t believe this is not just a simple on off switch, but thanks to you, it almost is now. Thanks again!
Hey – many thanks this was really useful. I can;t believe that apple didn’t include this setting thought the UI
Thanks! was very useful.
Setting com.apple.finder AppleShowAllFiles enables/disables the feature for all Finder views. I generally prefer the FALSE setting, but I have a few directories that I would like to view in Finder regardless of the setting. For this, I create symbolic links.
1. open Terminal
2. cd ~
3. ln -s .bash_profile BASH_PROFILE
Now I have a symbolic link to my .bash_profile that is visible in Finder, allowing me to select the file and edit or view.
Thanks, worked for me.
Thanks, but I copied and pasted the FALSE command and the hidden files are still visible? I restarted (not a cold boot) but still there. Any reason why? And how do I use the automator program to hide or unhide files? I thought it would be a simple program with a tick box.
Awesome! Thanks for the automator tool. Very handy.
Awesome! I was looking for this. Thanks a lot.
here’s a simple script that toggles:
if [ `defaults read com.apple.finder AppleShowAllFiles` == "TRUE" ]; then
echo “AllFiles = TRUE”
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
else
echo “ALLFiles = FALSE”
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
fi
Thank you for the useful tip!
Just a question:
I have a file (“config.txt”) that I want not to show on Desktop (but I need it to be on /path/to/desktop).
Have you some ideas to tell application Finder to hide it?
I’ve tried to change its “displayed name” property via applescript dot-prefixing it (keeping the same “name” property), but unsuccessfully!
Thank you again :-)
L.
Thanks for the info. I had to use Mick’s solution to get the script working correctly.
[...] Here is what I found; http://www.brooksandrus.com/blog/2007/03/23/mac-os-x-show-hide-hidden-files-in-finder/ [...]
Thank you :D !!!
This worked like a charm, thank you for sharing! :)
Thanks! Completely ignorant of the real workings of my computer, I didn’t even know how to access the terminal, so the directions and easy paste were fabulous. It’s a relief not to have my finder cluttered up with extra files, now I can finally find my stuff!
For Mac OS X an later: Find the hidden and system files on Mac OS X with Funter.
Funter is a freeware Mac utility that can show and hide hidden and system files in Mac OS X, including the user’s Library directory defaults to hiding on Mac OS X 10.7.
You can download it here:
http://nektony.com/funter
What a great post! I have no clue how you were able to write this post..it’d take me long hours. Well worth it though, I’d assume. Have you considered selling banners on your website?