Show hidden files on a Mac, and know which ones matter
One keyboard shortcut reveals the folders holding most of your disk. What becomes visible and what to do with each of them.
Finder hides roughly the half of your home folder where most of the disk usage actually is. Revealing it takes one shortcut, and knowing what you are looking at takes about two minutes.
The shortcut
In any Finder window, press Command, Shift and the full stop key together. Hidden files and folders appear in grey. Press it again to hide them. That is the whole trick, and it works everywhere in Finder including Open and Save dialogs.
Getting to Library specifically
- In Finder, hold Option and open the Go menu. Library appears in the list.
- Or press Command Shift G and type
~/Library. - Or drag Library into the sidebar once, and it stays there.
Making it permanent
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
# and to reverse it
defaults write com.apple.finder AppleShowAllFiles -bool false
killall FinderWhat you will see, and whether it matters
| Item | What it is | Do anything? |
|---|---|---|
~/Library | App data, caches, containers | Yes, this is where the space is |
.Trash | Your Trash | Empty it normally |
.DS_Store | Finder view settings, one per folder | No, harmless and tiny |
.npm, .cargo, .gradle | Developer caches | Yes, often gigabytes |
.config, .local | Command line tool settings and data | Sometimes large |
.CFUserTextEncoding | A tiny system file | No |
Measuring what you have revealed
du -sh ~/.[a-z]* 2>/dev/null | sort -h | tail -15That lists every hidden folder in your home directory by size. On a developer Mac the top of that list is frequently larger than Documents, which is the point of doing this at all, and it is covered in the dotfolders nothing cleans.
Common questions
How do I show hidden files on a Mac?
Press Command, Shift and the full stop key in any Finder window. Hidden files appear in grey, and the same shortcut hides them again. It works in Open and Save dialogs too.
How do I open the Library folder on a Mac?
Hold Option and open the Go menu in Finder, where Library appears, or press Command Shift G and type ~/Library. Dragging it to the sidebar keeps it available.
What are the hidden folders in my home directory?
Mostly configuration and caches for command line tools: .npm, .cargo, .gradle, .config and similar. On a developer Mac they are frequently larger than Documents.
Is it safe to delete hidden files on a Mac?
Some of them, but not as a category. Caches inside them are safe, while configuration folders hold settings you would have to recreate. Measure first and delete specifically.