How to check disk space on a Mac in Terminal

Storage Published

All of mac tips Try NotchStar in the browser Buy for $4

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.

Keep reading.

How to check disk space on a Mac
See how much storage is used and free on a Mac in System Settings, in Finder, and with one Terminal command. Includes why the numbers can disagree.
How to find large files on a Mac
Find the biggest files and folders on a Mac with Storage settings, Finder size sorting and two Terminal commands. Tested commands, and what not to delete.
What is System Data on a Mac, and can you delete it?
System Data is the catch all in Mac Storage for files that fit no other category. What it holds, why it grows and what is safe to look at.
Disk space, duplicates, apps and cleanup
See free space, find big folders, duplicates and app leftovers, compress media and clean caches from your Mac notch. Everything goes to the Trash.
How to find what is filling your Mac, and free space safely
Find what fills your Mac with Finder and Terminal, learn which folders are safe to clear, and what to leave alone. Commands tested, with a 20 minute routine.

More in Storage.

How to check disk space on a Mac
See how much storage is used and free on a Mac in System Settings, in Finder, and with one Terminal command. Includes why the numbers can disagree.
What is System Data on a Mac, and can you delete it?
System Data is the catch all in Mac Storage for files that fit no other category. What it holds, why it grows and what is safe to look at.
How to find large files on a Mac
Find the biggest files and folders on a Mac with Storage settings, Finder size sorting and two Terminal commands. Tested commands, and what not to delete.
How to clear caches on a Mac safely
Which cache folders on a Mac are safe to clear, how to check their size, and the rule that keeps you out of trouble: one app at a time, with the app quit.
How to find duplicate files on a Mac
Two files with the same name may differ, and two with different names may match. How to find true duplicates on a Mac by comparing content.
How to empty the Trash on a Mac safely
Empty the Trash from the Dock, restore items with Put Back, delete one item, handle locked files, and set the Mac to empty it after 30 days.
NotchStar app icon

Put your notch to work.

Buy it once for $4, activate it in a minute, and keep it. Not sure yet? Try every tool in the browser on the home page, or install the 7 day trial.