TIL: MacOS keyboard shortcut to show hidden files: Command + Shift + .
MacOS has a simple but not widely known keyboard shortcut that lets you toggle the visibility of hidden files and folders in Finder:
⌘ + ⇧ + . (Command + Shift + Period)
Hidden files and folders on macOS are those that begin with a period (dot) character, like .git
or .config
. By default, these files are hidden from view to prevent accidental modification of important system or application configuration files.
Before I learned this keyboard shortcut, I used to rely on terminal commands like:
defaults write com.apple.finder AppleShowAllFiles YES
followed by killall Finder
to show hidden files, which was much more cumbersome.
Interestingly, there's a keyboard shortcut but there's no menu item for it. At least not anywhere I could find.
The beauty of this keyboard shortcut is that:
- It works instantly - no need to restart Finder
- It's temporary - only affects the current Finder session
- It's toggleable - press it again to hide the hidden files
This shortcut is particularly useful when working with:
- Version control repositories (accessing
.git
folders) - Web development projects (editing
.htaccess
files) - Application settings (modifying
.config
files) - Package managers (working with
.npm
or.yarn
directories) - Cursor and
.cursorrules
files
It's one of those small productivity tricks that saves a lot of time once you commit it to muscle memory. Now whenever I need to check a hidden configuration file, it's just a three-key shortcut away instead of a terminal command that I'd likely have to look up.