How to Show Hidden Files on a Mac

The Directory Uncloaking Vector

The macOS operating system is built upon a strict Unix foundation. To prevent accidental catastrophic system failure, the Apple kernel mathematically cloaks thousands of critical configuration files, user library caches, and `.git` repositories by prefixing their filenames with a simple dot (e.g., `.htaccess`). When attempting to modify advanced developer settings or manually purge a corrupted application cache, these files are completely invisible to the standard Finder GUI. You must execute a system override to strip this cloaking attribute and render the files visible.

How to Show Hidden Files on a Mac

Apple engineered a highly specific, rapid-action keyboard shortcut that forces the WindowServer to instantly refresh and display all Unix-level hidden assets.

1. The GUI Override (The Keyboard Shortcut Protocol):
* This is the fastest and most efficient method for standard users.
* Open a new Finder window.
* Navigate to the directory where you suspect the hidden files reside (e.g., your primary User folder, or the root Macintosh HD).
* Press and hold the following three keys simultaneously: Command (⌘) + Shift + Period (.)
* The Finder window will instantly refresh. Hundreds of previously invisible files and folders will suddenly materialize. Crucial Visual Indicator: These uncloaked files are rendered with a slightly translucent, “faded” icon to differentiate them from standard, safe files.
* To Re-cloak: Simply press the exact same three keys (Command + Shift + Period) again. The files will instantly vanish, restoring the protective visual barrier.
2. The Deep System Override (The Terminal Protocol):
* If the keyboard shortcut fails, or you are writing an automated AppleScript, you must use the Terminal to inject the uncloaking command directly into the Finder’s preferences database.
* Open the Terminal application (Command + Spacebar, type “Terminal”).
* Type the following exact cryptographic string:
defaults write com.apple.finder AppleShowAllFiles YES
* Press Enter. The database is updated, but the currently running Finder application does not know yet. You must violently restart the Finder.
* Type: killall Finder
* Press Enter. Your desktop icons will vanish for a split second and reappear. All hidden files are now permanently visible across the entire operating system.
* To Re-cloak via Terminal: Run the exact same commands, but change `YES` to `NO` (i.e., `defaults write com.apple.finder AppleShowAllFiles NO` followed by `killall Finder`).

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.