ClearDisk
Buy for $10Download ClearDisk
A LITTLE MORE CLARITY

Check disk space on Mac in Terminal: measure, then decide

Terminal is the fastest way to size the folders Finder hides. Use df and du, which only read, then remove files through Finder and the Trash so you can put them back.

1. Open Terminal and understand the two safe commands

Apple’s guide gives two routes: open Launchpad and type Terminal, or open the /Applications/Utilities folder in Finder and double-click Terminal. Everything below uses two commands that only read the disk. df reports how full a volume is; du adds up the size of a folder. Neither changes a file.

Prefix nothing with sudo and do not paste commands that start with rm. This guide deliberately contains no deletion command, because the point of measuring in Terminal is to know what to remove in Finder, where the Trash gives you a way back.

2. Size the whole disk with df

Run df -h / and read the line for your startup volume: size, used, available and the percentage used. The available figure here is the free space; it does not include the purgeable space that Disk Utility and Storage settings fold into their available figure, which is why Terminal can show less room than System Settings does.

Write the used figure down. After any cleanup, run df -h / again; the difference is what you actually reclaimed, and it is the only number that settles arguments with a storage bar.

df -h /

3. Rank the Library folders with du

Run du -sh ~/Library/* 2>/dev/null | sort -h to size every folder inside your user Library and list them smallest to largest; the last lines are the ones that matter. The 2>/dev/null part hides permission errors for folders macOS keeps private. To go one level deeper into a big one, repeat with its path, for example du -sh ~/Library/Caches/* 2>/dev/null | sort -h.

Expect Caches, Containers, Application Support, Developer, Mail and Messages near the bottom of the sorted list. The Library guide explains what each holds and which ones to leave alone; the numbers you have just produced tell you which of them to read about first.

du -sh ~/Library/* 2>/dev/null | sort -h
du -sh ~/Library/Caches/* 2>/dev/null | sort -h

4. Find the hidden folders in your home folder

Developer tools keep caches in folders whose names start with a dot, which Finder hides. Run du -sh ~/.[!.]* 2>/dev/null | sort -h to size them. Typical entries are .npm, .cache, .cargo, .gradle and .docker, and on a developer Mac they can outweigh the Library.

For projects, du -sh ~/Projects/*/node_modules 2>/dev/null | sort -h, adjusted to your folder name, lists every node_modules by size in one command. The node_modules and package-cache guides cover what to do with them.

du -sh ~/.[!.]* 2>/dev/null | sort -h
du -sh ~/Projects/*/node_modules 2>/dev/null | sort -h

5. What Terminal cannot see, and where to go next

Terminal is limited by permissions like any app. Folders macOS protects return errors until you grant Terminal Full Disk Access under System Settings → Privacy & Security, and even then local snapshots, purgeable space and other volumes are not in a du total. If the folders you measured do not add up to the used figure from df, that gap is the explanation, not a hidden file.

Take the list to Finder: Go → Go to Folder with the path, review, move to the Trash, and empty it after the app has run again. A disk scanner produces the same list with allocated sizes and labels in one pass and adds a Reveal in Finder button, which is the step this guide does by hand. ClearDisk’s scan is free and runs locally; its cleanup is the same Trash-first move, from inside the app.

References & further reading

These guides combine the linked official guidance with ClearDisk’s documented behavior. Your files and app settings determine the right next step.

FROM A NUMBER TO AN ANSWER

See what’s using
your space.

Explore your Mac with ClearDisk’s free local scanner.
Review the files. Keep the control.

Download free scannermacOS 15+ · version 1.0Cleanup license: $10 once