MacOS – Hotkey to show hidden files and folders in File Open dialog

macos

This question is very similar to Is it possible to always show hidden/dotfiles in Open/Save dialogs?. How to show hidden files and folders in finder? is also related. However, I don't want to always show them, and that's what defaults write ... AppleShowAllFiles ... does.

Rather, I want to switch it on when needed. I'm trying to open .bash_profile, so I need it now:

enter image description here

Linux and Gnome allow us to CTRL+H to toggle between showing and hiding hidden files. But Gnome hotkeys don't work on OS X (which is expected).

For completeness, .bash_profile does exist in the home directory:

$ ls ~/.bash_profile 
/Users/jww/.bash_profile

A related question… As can be seen above, typing the filename in Finder (or is it Spotlight) search did not work. I tried to right click to get a context menu in the File Open dialog in hopes of checking a box like "show all files". And I tried the View menu looking for a "show all files" with the File Open dialog open.

Why is this hidden away somewhere? What purpose does it serve to not allow a user to easily open a file?

Best Answer

⌘ CMD+⇧ SHIFT+. reveals hidden files in Finder and Open/Save dialogs.

If you are using an AZERTY keyboard, you'll need to press fn too, so ⇧ SHIFT is taken into consideration as you already need it to make the ..


You can also press ⌘ CMD+⇧ SHIFT+G and type the path to the hidden folder, just like in Terminal (⇥ TAB autocompletion also works).

Editing hidden files can be dangerous if you don't know what you're doing.