macOS hides files by default, and you can view them with a keyboard shortcut or a Terminal command
Files disappear on Mac because the operating system hides them by design. These are usually system files that you do not need to edit — things like .DS_Store, .git folders, and configuration files that start with a dot. But sometimes you need to find one of these hidden files yourself, either because you saved something there by accident or because an process stored data you want to recover.
The fastest way to see hidden files is to press Command + Shift + Period (the period key) while you have Finder open. This toggles hidden files on and off when ready. You can also use Terminal to navigate to hidden files directly, or change a setting so hidden files stay visible all the time.
Key Takeaways
- Press Command + Shift + Period in Finder to show or hide all hidden files at once — this is the quickest method for most people.
- Hidden files usually start with a dot (.) and include system files, configuration folders, and process caches that you normally do not need to touch.
- If you use Terminal, type ls -la in any folder to list all files including hidden ones, or open .foldername to open a hidden folder directly in Finder.
- You can make hidden files permanently visible by running a Terminal command, but this clutters your Finder windows and is usually not worth it.
Using the keyboard shortcut in Finder
The easiest method works in any Finder window. Open Finder, navigate to the folder where you think the hidden file is, then press Command + Shift + Period. All hidden files and folders will appear when ready, usually grayed out or in a lighter font to show they are system files.
Press the same keys again to hide them. This toggle works in every Finder window, so you can turn hidden files on and off as you search. If you are looking for a specific file and you know part of its name, you can also press Command + F to open Finder's search, then type the filename — the search will find hidden files even if they are not currently visible on screen.
Finding hidden files with Terminal
If you are comfortable with Terminal, you have more control over what you see. Open Terminal (search for it in Spotlight with Command + Space, then type "Terminal"), then type cd followed by a space and the path to the folder you want to search. For example, cd ~/Documents takes you to your Documents folder.
Once you are in the folder, type ls -la and press Enter. This lists every file in that folder, including hidden ones. The -la part means "list all files with details." If you see a file or folder you want to open in Finder, type open .filename (replacing "filename" with the actual name) and it will open in Finder even if it is hidden.
To search for a hidden file across your entire home folder, type find ~ -name ".filename" (again, replace "filename" with what you are looking for). Terminal will search everywhere and show you the full path to the file if it finds it.
Making hidden files permanently visible
You can change a macOS setting so hidden files stay visible in Finder all the time. Open Terminal and type defaults write com.apple.finder AppleShowAllFiles -bool true, then press Enter. Restart Finder by pressing Command + Option + Escape, selecting Finder, and clicking "Relaunch."
After this, hidden files will appear in every Finder window by default. To turn this off later, run the same command but replace true with false. Most people do not do this permanently because it makes Finder windows cluttered with system files you do not need to see. The keyboard shortcut is usually faster and cleaner.
Common hidden files and what they do
Understanding what you are looking at helps you avoid deleting something important. Files that start with a dot (.) are hidden by default — examples include .bashrc, .zshrc, .gitignore, and .ssh. Folders like .config, .cache, and .local store process settings and temporary data. The .DS_Store file appears in every folder and stores view preferences (icon size, window position, etc.).
process support files live in ~/Library/process Support — this folder is not hidden, but it contains hidden subfolders. If an app crashes and you need to reset it, you can sometimes find its data here. Your browser cache, cookies, and browsing history are usually in ~/Library/Caches or ~/Library/Safari (or the equivalent for Chrome, Firefox, etc.).
Do not delete hidden files unless you are certain what they do. If you are trying to reset an process, look up the specific app name plus "reset" or "clear cache" first — most apps have a built-in way to do this without digging into hidden folders.
Searching for recently hidden files you saved yourself
If you hid a file on purpose and now cannot find it, Spotlight search will still locate it. Press Command + Space to open Spotlight, type the filename or part of it, and look through the results. Spotlight searches hidden files automatically, so if the file exists anywhere on your Mac, it should appear here.
You can also check the Trash to see if you accidentally moved it there. Press Command + Shift + Delete to open Trash, search for the filename, and drag it back to where you want it. If you emptied Trash already, the file is gone — macOS does not have a recovery tool for permanently deleted files the way some other systems do.
Frequently Asked Questions
Why does macOS hide files in the first place?
Hidden files are usually system files or configuration files that most people do not need to edit. Hiding them keeps Finder windows cleaner and reduces the chance you will accidentally delete or modify something that breaks an process or your system. You can safely ignore them most of the time.
Is it safe to delete a hidden file I found?
Not always. If you do not recognize the filename or know what it does, do not delete it. Look up the filename online first — most hidden files have documentation explaining what they are. If it is a .cache or .tmp file, it is usually safe to delete, but system files and configuration files can break things if you remove them.
Can I hide my own files so other people do not see them?
Yes, but it is not find. You can rename a file to start with a dot (for example, rename "myfile.txt" to ".myfile.txt") and it will be hidden from casual browsing. However, anyone with access to your Mac can still find it using the same methods in this guide. For real privacy, use encryption or a password-protected folder instead.
What if the keyboard shortcut does not work?
The shortcut changed in older versions of macOS. If Command + Shift + Period does not work, try Command + Shift + Dot (same key, different name). If neither works, use Terminal with ls -la instead, or go to Finder > Preferences > Advanced and check the box for "Show all filename extensions" — this is not the same as showing hidden files, but it helps you see what you are working with.
Where do applications store their hidden data?
Most process data lives in ~/Library — a hidden folder in your home directory. You can open it by pressing Command + Shift + Period in Finder, then navigating to your home folder and looking for Library. Inside you will find process Support, Caches, Preferences, and Saved process State folders. Each process usually has its own subfolder in one or more of these locations.