Skip to content
Thoughtful, detailed coverage of everything Apple for 34 years
and the TidBITS Content Network for Apple professionals
Finder icon wearing sunglasses

TipBITS: Reveal Invisible Files on the Mac with a Keystroke

Now and then, advanced Mac users need to work with files or folders that are normally invisible because their names start with a period. This need goes beyond revealing the ~/Library folder, which we wrote about first in “Dealing with Lion’s Hidden Library” (20 July 2011) and covered again in “Colonel Mustard in the Library with the Shift Key” (7 April 2017).

Some Unix-level files and directories start with a period so they are hidden by default, and many apps create such items to hide support files from the user. I currently have 61 files and directories that start with a period at the top level of my home directory, one dating as far back as 2008. That was a file called .Maelstrom-data that must have been related to the game Maelstrom, a fun blast from the past. Most recently, and the event that was the impetus for this article, I needed to check to see if I had a public key in ~/.ssh.

Because macOS is based on Unix, you can open Terminal and list all the files in a directory, including the invisible ones, with ls -asl (only -a is necessary, but I always use -asl to get hidden files, file sizes, and a detailed listing).

Terminal window showing hidden files

However, sometimes you don’t want to mess with Terminal, or it would just be easier if you could open one of these files in a text editor by dragging it to the app’s Dock icon. Wouldn’t it be helpful if you could just see these invisible files in a Finder window? You can!

Just press Command-Shift-. and watch your invisible files appear. The shortcut is easy to remember because the period is the character Unix uses to hide files and directories. (Bonus points to those who flinch slightly when typing it because your fingers remember when Command-. was the universal “stop it!” keystroke on the Mac.)

After you press that keyboard shortcut, all hidden files and directories appear, grayed out so you know they’re meant to be invisible, in all open Finder windows. Despite being grayed out, you can work with them like any other icons in the Finder, double-clicking them, copying or moving them, opening them in an app by dragging to the app’s Dock icon, or even trashing them. It all works. That said, don’t go nuts—you’re not meant to see or interact with these files, so if you don’t know what you’re doing, leave them alone.

Before and after screenshots of the Finder window with hidden files

(For those who are paying close attention to the screenshots, the difference in what’s showing between the Terminal listing and the Finder window is because ls puts the files that start with a capital letter together at the top, whereas the Finder doesn’t distinguish between cases when alphabetizing.)

As much as it might sound amusing to work with invisible files showing, they can clutter the display, so just press Command-Shift-. again to hide them. As long as you remember the keyboard shortcut, it becomes trivial to show invisible files, do what you need, and hide them again, all from the Finder.

Subscribe today so you don’t miss any TidBITS articles!

Every week you’ll get tech tips, in-depth reviews, and insightful news analysis for discerning Apple users. For over 33 years, we’ve published professional, member-supported tech journalism that makes you smarter.

Registration confirmation will be emailed to you.

This site is protected by reCAPTCHA. The Google Privacy Policy and Terms of Service apply.

Comments About TipBITS: Reveal Invisible Files on the Mac with a Keystroke

Notable Replies

  1. (Bonus points to those who flinch slightly when typing it because your fingers remember when Command-. was the universal “stop it!” keystroke on the Mac.)

    I’m curious why that sentence is written in the past tense. It sill is the way to cancel pretty much everything – I use it daily!

  2. I’ll have to pay more attention—my experience has been that very few apps support it anymore so I just gave up using it. Can you share some of the spots it works for you?

  3. Pretty much any dialogue box with a cancel button (Calendar, Pages, Numbers, Outlook, etc.). I basically always use it for “Cancel”. But that’s all I used it for in classic Mac OS (and System 7 before!) but maybe there were more places the key combo worked back then?

    I’ll try to be more conscious of where I use it and compile a list.

  4. I don’t do this all that often, but I do use it to stop music playing in iTunes.

  5. This tip does not work on El Capitan.

    I’m so used to using the space bar to start and stop playing media (since VLC supports that as well) that I never noticed this worked.

  6. Cmd-. stops Safari loading a page.

  7. For that, I reflexively hit Esc now.

  8. That’s what I used to do, but I just recently (say, in the last year) started using Cmd-. when I grew frustrated when I would highlight a song I wanted to play, press spacebar, and discover that iTunes was playing the last song that I paused (which I forgot I had paused, probably days before.) Now, I stop play when I am done, so that when I highlight a song I want to play, pressing spacebar plays that song.

  9. I just came here to say the same thing, when I noticed myself do that. I do it a lot, because I often accidentally start loading the wrong page.

  10. I think this is what finally caused me to stop using iTunes entirely. When I can’t figure out how to play the song I want to listen to, the interface is entirely broken.

  11. Good point. The one thing that should be obvious and work perfectly in an app like iTunes is playing a song. :slight_smile:

    The other day when I was having a hard time figuring out how to get iTunes to play/pause without using the mouse, I actually resorted to F8. I had never used that key before, but in that situation I noticed it and tried it. It turned out to be the one KB input I could find to do exactly what I wanted in the expected fashion repeatedly.

  12. Well, double-clicking a song, or pressing return when it is highlighted, always starts playing it. I just had spacebar in my head when maybe it shouldn’t have been.

  13. Typing Command-L goes to what iTunes thinks is the current song. That does not necessarily correlate to the highlighted song.

  14. This is the one major problem I have with Photos: live photos. I need to re-discover via Google searches that hovering over the Live button is how to show a Live photo every single time. My most recent re-discovery of this was only yesterday, so it’s still fresh in my mind, bu tit’s something I need to deal with about once per month at most.

    That said, now that I’ve finally written this down I’ll probably remember…

  15. It usually does the same thing as Escape. For instance, either will get you out of the modern Safari URL bar (command-L). But it’s definitely not universal anymore: Only Escape will get you out of a Finder rename.

  16. It still works in the Terminal as a way to quit running apps. I think it is being seamlessly interpreted as Control-C or something like that.

  17. Yeah, I’m sure you can use Esc everywhere that Cmd-. works, but I guess I still consider Cmd-. one of the two “universal ‘stop it!’ keystrokes” which was why I was thrown off by the use of the past tense in the article.

    I almost always use Cmd-. as it’s more convenient since my fingers are nearby and can reliably hit them – Esc is more of a stretch and I sometimes miss with my pinky. It’s probably also habit after all these years, too. Esc did work at times in classic Mac OS, but was inconsistent.

  18. Interesting to see that the whole thread is a kind of diversion from the topic, the cmd-shit-. to show invis files. For THAT I thank ya ACE, I never knew that!

  19. I’ve a brand new Macbook Pro from my employer. Twice now, its Trash claimed to have files in it but opening that in the Finder revealed … nothing. Weird. Better, I hadn’t deleted anything in Finder.

    An ls -a ~/.Trash in Terminal showed a .DS_Store file. According to various Internet postings, even if you have hidden files exposed (I do), macOS High Sierra still doesn’t display the .DS_Store files. Even weirder.

    Some questions: a) How’d that .DS_Store file get into my Trash? b) Why does macOS believe it’s a deleted file? c) Why have I never had a .DS_Store spontaneously appear in the Trash on my iMac (running the same version of macOS but definitely not brand new)?

  20. .DS_Store are quite simply index files, created by the OS in every directory (folder) that contain files. It’s been that way since the very first OS X. It’s just some metadata the system needs to store about those files. Even if all the files are later removed, that file remains.

    TL;DR: Pay no attention to that file, it’s a normal, invisible part of the macOS file system.


  21. Jeez! I know what a .DS_Store file is. They’ve been around since the earliest days of macOS, way before OSX. What I don’t know is why those files keep showing up in my Trash when I haven’t used the Finder to delete anything. And why it only happens on this new Macbook Pro.

  22. Why? Is it somehow causing a problem that you haven’t told us about and nobody else is reporting?

    The Finder isn’t the only thing that moves items to the Trash. For instance, every app that uses Sparkle framework as a self update mechanism moves the old app to Trash.

    And I often see the same on my old iMac, so I’m reasonably sure it isn’t unique to hardware.

    I can’t see how it makes any difference whatsoever to the use of your or my computer, so I’ll step away from attempting to address your specific questions. Sorry, but I need to focus my time on today’s malware issue.


  23. Same here. Cmd+. often does nothing.

  24. Back in System 7 days, and through Mac OS 8, I (and everyone I knew) ran an extension called something like “Escape, Damnit” that made the escape key send ⌘-.

    Was it because we were all secret Windows users? No, it was because hitting esc was much easier, faster, and more accurate than hitting ⌘-.

  25. He did report that his trash was registering as “not empty.”

  26. And then he said it was not empty, containing the invisible .DS_Store file.


  27. Dear All, I have used tricks such as this in the past to get into the hidden library files but I was always getting frustrated by my typos. I went looking on the net and found a free programme called “Show Hidden Files” by GOTOES.ORG. It is simply but it works. Regards Jen

  28. This technique does not appear to work in OS X 10.10.

  29. This shortcut does not appear to work on a French keyboard… If I switch to a US keyboard, it does work. The problem may be related to the fact that , for typinga dot with a French keyboard, you need to press the shift key, which is also part of the shortcut.
    I tried various key combinations, couldn’t make it work.

  30. Thanks for the tip. I’ve been using Onyx to reveal hidden files. But it requires restarting the Finder twice, and restarting, now that I’m using it, Total Finder as well. A multi-step process to say the least. Shift-Command-. is way easier. I’ll be remembering it (I hope). I wonder why it never showed up in lists of keyboard shortcuts? Perhaps because revealing hidden files can be dangerous for the inexperience user. Or perhaps because other “experts” weren’t aware of it. It is pretty obscure.

    I also was unfamiliar, or had forgotten, Command-. to quit stuff. In particular it has always bugged me that there did not appear to be a way to stop a song in iTunes. The Spacebar paused songs, but often that was not enough. This is another tip I’ll be remembering. The fact that they’re similar won’t hurt.

    As for hitting the Escape key, I don’t use my pinkie finger. I use my first finger, using my index finger to gauge the small space from the edge of the keyboard.

  31. This only seems to work in Open/Save dialog boxes on older macOS versions. I can’t get it to work with Finder in 10.9 or 10.10 and I see a comment that it doesn’t work with 10.11.

    What versions is it known to work with in Finder? Or is there a terminal setting we can change?

  32. In Path Finder, the keypress for showing/hiding invisible files is Command-Shift-I and is shown under the View menu.

  33. One of my long-delayed projects is to set up virtualized versions of as many iterations of macOS as I can (which I think would be at least Lion on up, and maybe Snow Leopard). Then I could more easily test this stuff.

    I know this trick works in Sierra and High Sierra.

  34. I don’t know if this has been mentioned, but when this Finder trick appeared in Sierra and High Sierra, it actually applies to ALL open Finder windows (including the desktop) in one fell swoop, not just the particular Finder window that might be frontmost.

    That is to say, if you have two Finder windows open and press Command+Shift+Period, you’ll see both windows (and the Desktop) reveal any hidden “dotfiles” and directories, and any typically invisible directories like ~/Library.

  35. No tricks or apps needed. In the finder hold down the option key while accessing the “GO” menu, and “Library” will be revealed.

    You can also add a keystroke (Like ⌘⇧-L, perhaps) using the keyboard preferences.

    Or if you want to get really clever, use dictation commands:


    NB: I’ve been using the shortcut for years and years, so I am surprised at people saying it doesn’t work or is a new feature. Here is a post from 2009 about using this command in OS X 10.6.

  36. Thanks for that I’d forgotten about Dictation Commands.


Join the discussion in the TidBITS Discourse forum


Avatar for ace Avatar for kreme Avatar for Simon Avatar for tommy Avatar for mac Avatar for aforkosh Avatar for dgheap Avatar for garth Avatar for alvarnell Avatar for jzw Avatar for jeff5 Avatar for ddmiller Avatar for henry.crun Avatar for jjacomb Avatar for jtbayly Avatar for tidbits41 Avatar for ordbfr Avatar for geoffduncan Avatar for ulf Avatar for tewha Avatar for Smithcraft Avatar for waynec