TipBITS: Reveal Invisible Files on the Mac with a Keystroke

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)?

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

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.

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-

Command-. stops the bounce process in Logic.

Same here. Cmd+. often does nothing.

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 ⌘-.

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

Wonderfully useful tip, many thanks!

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

-Al-

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

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

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.

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.

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?

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

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.

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.

1 Like

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:

56

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.

http://hints.macworld.com/article.php?story=20090915152215383

1 Like

Thanks for that I’d forgotten about Dictation Commands.

Re-instated.