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

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 28 years, we’ve published professional, member-supported tech journalism that makes you smarter.

Registration confirmation will be emailed to you.

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.

    -Al-

  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.

    -Al-

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

Join the discussion in the TidBITS Discourse forum

Participants