How to find hidden files on Mac
macOS hides files whose names start with a dot, such as .zshrc or .git, and folders like your user Library. Here are four ways to see them, from a one-off peek to searching every hidden file by name.
1. Show hidden files in Finder with ⌘⇧.
- Open a Finder window, or an Open or Save dialog.
- Press ⌘ ⇧ . (Command, Shift and the period key).
- Hidden files appear dimmed. Press the same keys again to hide them.
This is the quickest way to look inside one folder. It does not help you find a hidden file when you don't know which folder it is in.
2. Open the hidden Library folder
In Finder, click the Go menu and hold ⌥ Option. Library appears in the list. You can also choose Go › Go to Folder (⌘ ⇧ G) and type ~/Library.
3. Use the Terminal
List everything in a folder, hidden files included:
ls -la ~
Make Finder always show hidden files, then restart Finder:
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
# back to normal
defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder
Find hidden files by name anywhere in your home folder (this walks the disk, so it can take a while):
find ~ -maxdepth 3 -name ".*" 2>/dev/null
To hide or unhide a file without renaming it, use chflags hidden file and chflags nohidden file.
4. Include hidden files in Finder search
- In Finder, press ⌘ F and choose This Mac.
- Click the first criterion (Kind) and choose Other….
- Find System files, tick it, and set it to are included.
Finder search relies on Spotlight, which skips some folders on purpose, so hidden files can still be missing from the results.
Search every hidden file by name, instantly
Everything Locator keeps its own index instead of using Spotlight, so it can include hidden files and find them as you type:
- Open Settings › Indexing, tick Index hidden files and folders, and choose Apply and Rebuild Index.
- Type a name, or use the search syntax:
| Search | Finds |
|---|---|
.env | every file or folder with ".env" in its name |
startwith:. parent:~ | the dot files directly in your home folder |
wfn:.gitignore | files named exactly .gitignore |
folder: wfn:.git | every Git repository |
.ds_store size:>100kb | unusually large .DS_Store files |
Find any file as fast as you can type
Everything Locator searches your whole Mac by name, including hidden files, iCloud Drive and OneDrive.