Show Hidden Files in Mac OS X

Feb 25, 2009 - 54 Comments

Finder If you find yourself needing to access hidden files on your Mac, like an .htaccess file you downloaded, a .bash_profile, a .svn directory, – literally anything preceded with a ‘.’ indicating it is invisible by default – you can run the below command from the terminal to set hidden files to become visible throughout OS X.

For some quick background to fill in 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 placing a period in front of the name, thus making it invisible to the Finder. Let’s make all hidden files become visible in OS X:

How to Show Hidden Files & Folders on Mac

This changes the default setting of Mac OS X so that Finder always shows all files. Launch the Terminal (found in /Applications/Utilities) and enter these commands exactly as shown. The first command activates the ability to see the hidden files:

For showing hidden files and folders in OS X El Capitan 10.11, Yosemite 10.10, and OS X Mavericks 10.9, use the following command string:

defaults write AppleShowAllFiles TRUE;killall Finder

There is a very slight difference in casing for making hidden files and folders visible in other versions of Mac, including OS X 10.8 Mountain Lion, 10.7 Lion, 10.6 Snow Leopard, where the setting remains as the following defaults string:

defaults write AppleShowAllFiles TRUE

Hit Return, nothing happens yet because you must relaunch the Finder for the changes to take effect. This is done by ‘killing’ the Finder process, which is also done through the command line with the following string:

killall Finder

Again, hit Enter/Return, and you’ll discover the Finder quits and relaunches itself very quickly with the changes in effect.

“Hidden” files are now visible in Finder windows, but they will display as a dimmed version of their respective file icons, being slightly transparent. Examples of how hidden files show up in the Finder are shown below.

This is how hidden files look when they’re visible in a modern version of Mac, like an OS X Yosemite (10.10.x) Finder window, note the hidden folders and files are visible but have dimmed gray names:

Hidden files visible in Mac OS X Finder

And this is how the once invisible files show in prior releases of OS X, highlighted here:

Hidden files shown in Mac OS X

This setting stays in place until it has been reversed or disabled, which would cause all files to become hidden again just as the default. With all the files visible a Finder window can look much busier than you may be accustomed to, and it’s not always desired to leave on constantly. Thankfully it’s just as easy to switch back.

Finder icon

Remember the Finder must relaunch to show hidden files and folders, they will appear as slightly translucent icons alongside the normal icons. The files and folders that are hidden typically will have a ‘.’ in front of their name, but other items can be hidden as well through chflags commands.

Note that refreshing Finder is always necessary. This is the same in OS X Yosemite and old versions of Mac OS X too, the Finder must always be refreshed this way to reveal the hidden folders and files.

Reverse to Default & Make Files Hidden Again

To hide files that are intended to be hidden again, thus going back to the default Mac settings of keeping them invisible, you can just type the following defaults command. As you can see, everything is the same except that TRUE has been switched to “FALSE”:

defaults write AppleShowAllFiles FALSE

Remember the slight difference in OS X Mavericks and Yosemite has to do with capitalization:

defaults write AppleShowAllFiles FALSE;killall Finder

Hit return, and 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! The change will revert and you’ll be back to the default with hidden folders and files no longer visible in the OS X Finder.

Show Hidden Files in a Mac Open or Save Dialogue Temporarily

Another approach to without using the above defaults command is to quickly show all hidden files in any Mac OS X Open or Save dialogue box by hitting Command+Shift+Period on the keyboard together. You will instantly see the change as once-hidden files are revealed.

show hidden files mac That command sequence can be used to toggle back or forth, thereby revealing and hiding the files again as needed. For many users, this keystroke is the most appropriate use for when an invisible file must be modified but there is no need to make them all visible all the time.

Show Hidden Files & Folders on a Mac Temporarily with Terminal

Another way to quickly see hidden files in OS X 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, making it a temporary measure to quickly see all contents of any directory or folder, even if the above defaults command isn’t used.

One way to carry over the terminal to the GUI though would be to use the ‘open’ command, directed at a hidden file. Here’s an example:

open .not_visible_by_default

show hidden files mac This will launch the file called “.not_visible_by_default” into the default GUI app associated with it’s file type, in this case it would be a text file and so TextEdit would open. This trick can also be used to open hidden directories into the Finder, for example with the following syntax:

open ~/.git

That would launch the hidden “.git” directory in a users home directory into a Finder window, without revealing all other files.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

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


» Comments RSS Feed

  1. Paul says:

    There is a simple app you can install to do this, called “Blind” Check it out here:

  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…

    • derpy says:

      or you could just not leave an unnecessary comment and stop being a self-righteous macsnob…and also…you’re lame…and also…this is an old ancient post… and also… your mom

      • Dick.Zombi says:

        Terminal comes with your Mac… No download required.
        Post = Necessary.
        It’s funny to see the self-righteous of one bash the self-righteous of another. Go Linux.

    • Bruce says:

      Old, old, old news that, to this day, is still important because Apple doesn’t think its users need obvious ways to see hidden files. When software is written in a way that seems to imply that it knows better than its users what should be allowed (e.g. seeing “invisible files”), then the software writers are both arrogant and wrong.

      • Bob says:

        You have obviously never seen my mom use a computer. It is arrogant to assume that everyone has the same ability to understand tech that you do.

  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.

  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: 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 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. Don says:

    Just what I was looking for. Thanks.

  23. […] a networked Mac, using the Finder is an easy way to copy the SSH keys. First you’ll want to show hidden files in OS X either through defaults write or a tool like DesktopUtility, then just open up the .ssh […]

  24. […] The fix is quite simple: go into your project directory, and locate a file called .snap which is listed under the following path on Mac OSX: .metadata/.plugins/org.eclipse.core.resources Once you have deleted this file, simply restart FlashBuilder and you should be good to go! *Note that you will need to turn on hidden files in order to see the .metadata folder, instructions on how to do that can be found HERE. […]

  25. Nick says:

    I tried to hide the hidden files again but it wont work

  26. Mohammed EL ASSAL says:

    Thank you so much for your contribution !!

  27. […] modified plist files will float to the top fairly quickly, though of you have hidden files shown, you’ll see temporary plist files show up first, ignore those and just focus on the normal […]

  28. rebecca says:

    ok, this may seem ridiculous but a bit of an amateur here, how do you access the terminal to type commands in? Am on a macbook running OS X 10.5.8


  29. […] and all root subdirectories (like ls -a / would show at the command line), you will need to set hidden files to be shown by the Mac OS X Finder. The directories and files deemed hidden by way of the chflags command or […]

  30. Frank says:

    Thank you! Was in a pickle and really needed to see my hidden files. This command worked great.

  31. […] in mind that if you want to view hidden files through this method, you must enable hidden files to be shown in the Mac OS X Finder separately, which will then carry out through every folder until it is […]

  32. […] writes commands and manually relaunching the Finder: hide desktop icons and show them again, show invisible files and hide them again, and show the user library or hide it again. No more launching Terminal to […]

  33. eric says:

    Whether this is old news or not, I didn’t know it, and I just tried it, and it worked. That is great. Thank you.

  34. Sam says:

    On some versions of the operating system, it requires a YES to enable, and a NO to disable, instead of TRUE or FALSE.

    It will not give you any feedback if successful.

    Do a killall Finder to see the change.

  35. […] who have a few Mac’s on their networks, where seeing the files turn up when hidden files are made visible. Here is my explanation as to what a DS_Store document is, what happens if you delete them, and how […]

  36. […] it’s because the zipping tools default behavior is to including hidden files whether they are shown or not. That’s not necessarily a bad thing and in many cases it would be considered useful, […]

  37. […] are actually stored in the “.DS_Store” files that are seen when hidden files have been made visible on the Mac. You can think of that ds_store file as a thumbnail cache of sorts, but it also contains […]

  38. […] Terminal to show hidden files and relaunch the Finder using this defaults command […]

  39. R says:

    Thank you……. this info is really helpful !

  40. NH says:

    I have a question… I saw a .dsstore and .local file on the desktop that I assume were copied there from my FTP by mistake.. after I fixed the file that was wrongly marked with the dot, is it safe to trash those ?

  41. Martin says:

    Command+Shift+. on Mavericks doesn’t work well in column-view mode. Have to click in and our of folders. Not reliable. Works well in list view though.
    Great tip! Used OSX for years without knowing that shortcut…

  42. kizi says:

    i did it but can’t see file (.htaccess) yet? can anyone help

  43. Richmond says:

    That’s not the only one – there is also another freeware XHider, which also allows you to hide files. You can get it here:

  44. Pristique says:

    LOL giving advice to trust third party apps trust that require sudo privileges on OS X is silly. That is probably the single easier way to completely compromise the security of your entire system.

    • clueless says:

      What are you even talking about? This is showing how to display hidden files by using defaults commands. All defaults commands are part of OS X system modification, they are not third party and there is no requirements to use any third party anything to make hidden files visible on a Mac.

  45. Glauco Zega says:

    Thank you so much!

  46. jos. says:

    More easily understood than the directions on the MAC support pages. Greatly appreciated!!

Leave a Reply


Shop for Apple & Mac Deals on

Subscribe to OSXDaily

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