0

With something like diskutil info /dev/disk1s1 among other things I can get my free space as follows:

Container Free Space:      28.3 GB (28347076608 Bytes) (exactly 55365384 512-Byte-Units)

The question is, how can I get purgeable space as shown in Disk Utility's GUI 30.41 GB (2.05 GB purgeable) from diskutil CLI ?

2 Answers 2

2

how can I get purgeable space as shown in Disk Utility's GUI 30.41 GB (2.05 GB purgeable) from diskutil CLI ?

Unfortunately, this is not possible.

The purgeable space reported by the (GUI) Disk Utility is a summation of the temp files, caches, backup files, Trash, and even some iCloud data (from Optimize my Mac). A simple reboot will clear out a lot of these as will emptying the Trash.

You could potentially get an approximation of this info with the command

% du -ch -d0 ~/.Trash ~/Library/Caches $TMPDIR 

That will get you a nice summation of the bulk of the purgeable space excluding iCloud optimizations and any other temp/cache files not stored in the directory referenced by TMPDIR.

1

The diskutil command can not output the amount of “purgeable space”. The accuracy of the amount of “purgeable space” reported by the Disk Utility application (IMO) is questionable since the value differs from what the Finder application reports.

The Get detailed information about a disk in Disk Utility on Mac section of “The Disk Utility User Guide” for Ventura defines “purgeable space” as the following.

space that macOS can free up when needed by removing files from your computer (you can’t manually remove the files that are designated purgeable, but macOS removes them as space is required)

So “purgeable space” can not include files in the Trash. Nor, can purgeable space include allocated space documented to be removable by restarting your Mac.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .