Friday, November 5, 2021

diskspace Tool to Report APFS Free Space

Armin Briegel:

With the recent versions of macOS, getting a value of the available disk space is not as strightforward as it used to be. There are a lot of files and data on the system, which will be cleared out when some process requires more disk space. Most of this is cache data or data that can be restored from cloud storage. But this ‘flexible’ available disk space will not be reported by the traditional tools, such as df or diskutil. The available disk space these tools report will be woefully low.

The available disk space which Finder reports will usually be much higher. There is functionality in the macOS system frameworks where apps can get the values for available that takes the ‘flexible’ files into account.


I built a command line tool that reports the different levels of ‘available’ disk space. When you run diskspace it will list them all. There are raw and ‘human-readable’ formats.

It’s open source and available here.


4 Comments RSS · Twitter

Thanks. It would be great to have a GUI for it. After all, that is why we use Mac (the GUI).

It's too bad that the App Store still has no meaningful handle on available disk space in regard to updating Xcode. (Despite proclaiming a need for 12 GB, it still refuses to install with 30 GB free.)

@ Ben: and it doesn’t even tell you how much space
it was looking for — nor does the Updates page tell you how big each update is.

At least in Monterey you can make space for Xcode by clearing snapshots using Disk Utility.

Leave a Comment