How to check disk space on a Mac in Terminal
Open Terminal and run df -h /System/Volumes/Data. The Used and Avail columns show plain figures for the volume that holds your files. Unlike Finder, this number does not include space the system can reclaim by itself, so it is the stricter measure.
Free space
df -h /System/Volumes/Data
df reports free disk space, -h prints readable sizes, and the path is the volume with your files. Note Avail before you start a cleanup and again after.
Which folders use it
du -sh ~/* 2>/dev/null | sort -h
du reports usage, -s gives one total per item, -h makes sizes readable, ~/* is every visible item in your home folder, 2>/dev/null hides permission errors, and sort -h orders 900M before 5G. The last line is usually the Library folder. Go one level down:
du -sh ~/Library/* 2>/dev/null | sort -h | tail -8
Single big files
mdfind -onlyin ~ 'kMDItemFSSize > 1000000000'
That lists every file over one gigabyte in your home folder.
Reading the output
The first column of df names the volume, then come size, used and available figures, and a capacity percentage. Compare Avail with the size of what you plan to download or install. If you are under about ten percent free, plan a cleanup before the next big update, because macOS needs room to work. That ten percent is a rule of thumb, not an Apple figure.
Safety
None of these commands delete anything. A command ending in rm deletes for good and skips the Trash, so when you remove something, drag it to the Trash in Finder instead. Do not type paths from memory after sudo rm.
Why Terminal and the Storage screen differ
The graphical Storage screen in System Settings includes purgeable space and works in the background. Terminal gives the raw figure. Neither is wrong. For the graphical route, see check disk space on a Mac.
Next steps
Use find large files for the full method and what System Data is if one category looks too large. The blog post free up space on your Mac without a cleaner puts these commands in a 20 minute routine.
No Terminal needed
NotchStar’s Disk tool shows free space for every drive and ranks folders by size with buttons instead of commands.