Show Hidden Files in Mac OS X

Feb 25, 2009 - 23 Comments

show hidden files mac If you find yourself needing to access hidden files on your Mac (say an .htaccess file you downloaded), run the below command from the terminal.

For those who don’t know, files that are hidden in Mac OS are determined so by preceding the filename with a single period symbol (.), you can actually make any file hidden by doing this.

Show Hidden Files on your Mac

Launch the Terminal and enter these commands exactly as shown. The first command activates the ability to see the hidden files:
defaults write com.apple.Finder AppleShowAllFiles TRUE

Now you must relaunch the Finder by killing it, this is how the changes take effect:
killall Finder

If you want to hide hidden files again (those preceded with a .) and go back to the default Mac settings, you can just type the following:
defaults write com.apple.Finder AppleShowAllFiles FALSE

Again you will need to kill the Finder so that it can relaunch for changes to take effect:
killall Finder

That’s all there is to it!

Show Hidden Files in a Mac Save Dialogue

You can quickly show all hidden files in any Mac OS X save dialogue box by hitting Command+Shift+Period

Show Hidden Files on your Mac through the Terminal

Another way to quickly see hidden files is by using the ls command within the Terminal, at the command line type the following:
ls -a
The -a flag tells the ls (list) command to show all contents, including hidden files. You then just have to specify a directory if you want to see the hidden files in it:
ls -a ~/Sites/betasite
This method does not effect the Finder or the visibility of hidden files outside of using the -a flag.

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Tips & Tricks

23 Comments

» Comments RSS Feed

  1. Paul says:

    There is a simple app you can install to do this, called “Blind” Check it out here: http://www.macupdate.com/info.php/id/22495/blind

  2. ac_poster says:

    or you could type in that command into the terminal which is far easier…. and also… this is old news how to do this in mac os x… old ancient news…

  3. YourT says:

    Instead of YES it Should be TRUE

  4. SpearBoy says:

    Try iTweax for a change. By far the best tweaking tool for osx.
    It even has Safari4 beta support.

    http://www.itweax.net

  5. bjs1990peregrine says:

    Tnomeralc, I’ve found an easy way to hide folders without buying an application. First, use the command listed above to show hidden files. Then, rename the folder you’d like to hide by adding a dot (.) at the beginning of the name. For example, “MyFolder” would become “.MyFolder”
    After that, hide the folders again and you’re all set!

    Hope that helps!

  6. [...] can actually set Mac OS X to display hidden files by issuing a command in the Terminal. This will expose your hidden folder completely within the [...]

  7. [...] you want a more permanent solution so that you can always see the files, check out our article to show hidden files on Mac OS, which offers a command to always see the hidden files even within the [...]

  8. DD says:

    Sooo simple! though I’ve been a Mac user since 1987 I’ve never needed to hide a file. Now I do and I did in a few seconds. Thanxxxx

  9. [...] Hidden Files in Mac OS X. Available: http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x Last accessed 16th Nov [...]

  10. [...] with a period are hidden by default in the Finder and the Mac dialog boxes. If you want to, you can set Mac OS X to always show hidden files by using a defaults write command. In this case, the Command+Shift+Period keystroke has the [...]

  11. [...] you don’t want to bother with defaults write commands or the terminal, an alternate method to show hidden files in Mac OS X is to simply use the Chrome web [...]

  12. Guest says:

    Bifocals http://www.bifocalsapp.com/ offers a free menu bar app to do this as well.

  13. [...] problem with traditional solutions like a defaults write command to show hidden files in Mac OS X is that they’re permanent unless another defaults write command is executed, this [...]

  14. [...] have a .bash_profile, create one with your favorite text editor – you may need to do this in order to see it, as it will be a hidden [...]

  15. Paul says:

    Need to turn it on an off? I use it when working on volumes on a Mac OS X Server or other Unix boxes, typically for .htaccess files. I only need it on occasionally and don’t want the clutter or risk otherwise.

    So using a plain text editor create two simple files with the commands to turn on and off. (TextEdit won’t do, but Word will save in plain text)

    Make them executable with chmod thru Terminal. Use Finder’s Get Info to set them to open with Terminal

    From then on you can double-click it to switch between showing and hiding.

  16. [...] of the Terminal to create. It’s also advantageous because it doesn’t show up if someone makes hidden files visible. I would suggest burying this folder somewhere in an obscure place on the desktop or elsewhere to [...]

  17. Anthony says:

    Thanks a ton! I’ve been using Houdini to reveal the .htaccess files so far but it’s far more convenient to have hidden files revealed by default.

  18. [...] you don’t want to deal with manually hiding and showing the desktop icons, showing hidden files, accessing the user library directory, and forcibly emptying the Trash, grab DesktopUtility for [...]

  19. [...] run the below command from the terminal. For those who don’t know, files that are hidden in Mac OS are determined so by preceding the filename with a single period symbol (.), you can actually make [...]

  20. Arvid Nielsen says:

    Great help – thanks man!

    Any of you guys want to keep that particular folder or file at hand, after having hidden files again, without having to do the whole Terminal thing? (To me it’s quite scary to mess with the system like that, anyway.):

    Drop the folder or file onto the sidebar of your Finder window. Now, you should be able to access it, directly and easily, in the future.

  21. radarak says:

    what about ~/private/var/vm ?!
    this is the folder for creating huge snapshots of os which changes alot.

  22. macbeth says:

    Oh, please don’t be a crybaby ac_poster, MacOsXHints don’t owe hints and tips, they’re available for anyone – not copyrighted or nothing, so stop your whining and be happy for new Mac Users. Old ancient news you say, for whom? Those who have known for a while? For newbies it is News. – Instead consider this: Try search the internet for ‘show hidden files 10.6′. The first two hits are open/save dialogues, the third hit is this page. Instead try improving macosxhints’ GUI, it is not User Friendly when you find your tip in the comments below (jantonc)..

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook