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



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

  1. James says:

    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!

  2. dan says:

    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.

  3. [...] 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 [...]

  4. MiaulementQ says:

    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!

  5. [...] 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 [...]

  6. Raul says:

    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!!!

  7. Danny says:

    Just wanted to say thanks. I too always switch this on and off. Thanks for showing me how to switch it this time around!

  8. Rowan says:

    Awesome mate, cheers!

  9. Ram says:

    It was really helpful.Thanks!!!

  10. Rachel says:

    Thanks!! It helped a lot. Now my mac is back to “normal”

  11. storyofcory says:

    Thanks for posting this easy to understand tip. It is much appreciated.

  12. slaapkop says:

    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.

  13. Piya says:

    Thanks!

  14. [...] 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, [...]

  15. gailo says:

    Thank you very much!!!

  16. Monzter says:

    Thanks For sharing great tutorial !!

  17. Angus says:

    I used a program to show them and now i cant get rid of it and that didnt work :)

  18. Nate says:

    Wow dude thank you so much. Its about fucking time someone can give clear understanding directions about how to do something. SERIOUSLY thank you.

  19. Dyan says:

    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!

  20. Ashlyn says:

    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!

  21. Athoob says:

    Thank you! That helped a lot!

Leave a Reply