Finder · hidden files
How to show hidden files on a Mac
In a Finder window, press Shift-Command-. (the full stop key) and hidden files and folders appear, greyed out. Press it again to hide them. In Terminal, ls -a lists them. Most hidden files are small settings files, but a few hidden folders, such as ~/.cache and ~/Library, can hold gigabytes.
Show hidden files in Finder
- Open a Finder window on the folder you want to look in. For your home folder, press Shift-Command-H.
- Press Shift-Command-. (Shift, Command and the full stop key together). Files and folders whose names begin with a dot, and folders such as Library, appear in grey.
- Press the same keys again to hide them. They are greyed out for a reason: most of them are settings an app expects to find exactly where they are.
If you only need one hidden folder, you do not have to show them all. Choose Go → Go to Folder (Shift-Command-G) and type its path, such as ~/.cache. For your Library folder, open the Go menu, hold the Option key and choose Library; the Library folder explains what is in it.
Show hidden files in Terminal
ls leaves out names beginning with a dot unless you ask. The -a option includes them:
ls -la ~That lists everything in your home folder, dot files included. Nothing is changed or deleted: ls only reads.
The two kinds of hidden
macOS hides an item from Finder in one of two ways, and it helps to know which you are looking at:
- A name that begins with a dot, such as
.zshrc,.npmor.cache. This is the Unix convention, and it is what most command-line and developer tools use for their settings and downloads. - The hidden flag, which the
chflagsmanual describes as "Hide item from GUI". It hides a normally named item, such as~/Library, from Finder while Terminal still shows it.
To see the flag, add -O to a long listing:
ls -ldO ~/LibraryThe word hidden in the output is the flag. chflags nohidden followed by a path clears it, and chflags hidden sets it again; the manual says that putting "no" in front of a flag's name clears it. Do that for your own folders, not for ones macOS hid itself.
Which hidden folders take space
Most people go looking for hidden files because their disk is full and Storage settings will not say why. Finder's sizes skip hidden folders unless you show them, so they are easy to miss. To measure the hidden folders in your home folder, run:
du -sh ~/.[!.]* 2>/dev/null | sort -h | tail -15The largest are listed last. The ones that usually matter:
~/.cache: downloads cached by command-line and developer tools, and on some Macs the models and runtimes AI tools fetch. Clearing the cache on a Mac covers it with the other caches.~/.npm,~/.gradleand~/.pub-cache: packages that npm, Gradle and Dart download once and share between projects. They are fetched again on the next install or build.~/.android: Android emulators, each with its own disk image.~/.codexand~/.claude: AI coding tools' history and settings, with a small download cache beside them. See the hidden data AI tools leave.~/Library: hidden by flag, and usually the largest of all. Caches and Logs inside it can be cleared; most of the rest is your apps' data.
What to leave alone
- Small dot files such as
.zshrc,.gitconfigand.sshhold your shell settings, your Git identity and your SSH keys. They take almost no space, and deleting them breaks things that are hard to put back. .DS_Storefiles, which Finder writes into folders to remember how a window looks. They are tiny and Finder writes them again.- Hidden folders at the top of the disk, such as
/privateand/usr. They belong to macOS. - Anything in a dot folder that is history rather than cache, such as an AI tool's past sessions. Move it to the Trash rather than deleting it outright, so you can put it back.
Why they come back
Hiding a file does not make it go away, and showing it changes nothing about it. The caches in hidden folders refill as your tools work, because that is what a cache is for. Clearing one helps when the disk is short; it is not a one-off fix.
Where the app comes in
RefreshYourMac reads the hidden folders for you, so you never have to show them or type a path. It lists Command-Line Tool Cache (~/.cache), the NPM Cache and Gradle Caches as their own categories, each rated Safe for auto removal, because each is re-downloaded on demand. The Dart & Flutter Package Cache and Android Emulators are rated Review before deleting, because getting them back costs a download or a rebuild. Codex Sessions & Plugins is rated Backup recommended, since it is history, not cache, and is moved to the Trash so it can be restored. These hidden-folder categories are in the download edition only. The visible places that fill a disk are in how to free up space on a Mac.
What to do next: see these numbers for your own Mac. Download RefreshYourMac free, or get it on the Mac App Store.
What it costs to have an app do this
| RefreshYourMac | CleanMyMac | MacKeeper | |
|---|---|---|---|
| Pay once | $24.99 | €119.95 on MacPaw’s store; $89.99 for CleanMyMac X on the Mac App Store | subscription only |
| Yearly | $14.99 a year, first 7 days free | $39.99/yr on the Mac App Store; €39.95/yr on MacPaw’s store | €71.40 for the first year, 1 Mac. Their page shows it against a €119.40 list price |
| Monthly | $1.99 a month | $9.99/mo | €10.95/mo |
| Account needed | No | Yes | Yes |
Before you pay anything, both versions give you 3 free scans. CleanMyMac and MacKeeper prices read from their own pages and the Mac App Store on 27 October 2026; the full comparison is at RefreshYourMac vs CleanMyMac and MacKeeper.
Frequently asked questions
What is the shortcut to show hidden files on a Mac?
In a Finder window, press Shift-Command-. (the full stop key). Hidden files and folders appear in grey; press the same keys again to hide them. In Terminal, ls -a lists them.
Why are some files hidden on a Mac?
Most are settings files and folders that apps expect to find exactly where they are. A name that begins with a dot is hidden by convention, and some folders, such as ~/Library, carry a hidden flag that keeps them out of Finder.
Which hidden folders take up the most space on a Mac?
Usually ~/Library, then the caches developer and command-line tools keep in ~/.cache, ~/.npm, ~/.gradle and ~/.pub-cache, Android emulators in ~/.android, and AI coding tools’ folders such as ~/.codex. In Terminal, du -sh ~/.[!.]* | sort -h lists them by size.
Is it safe to delete hidden files on a Mac?
Some. Caches in hidden folders are fetched again when a tool needs them. Small dot files such as .zshrc, .gitconfig and .ssh hold your settings and keys and should stay, and hidden folders at the top of the disk belong to macOS.