HACKER Q&A
📣 Azisk

How do you check for free space on your lap-top?


I have these 2 aliases to check the free space and the size of folders on my Mac alias space='diskutil info /dev/disk1 | grep "Volume Free Space"' alias size='du -h -d 1'


  👤 ktpsns Accepted Answer ✓
You are a victim of the difference of (summed) real file size (output of du) vs free space as reported by the filesystem (reported by df on Linux and assumably diskutil on Mac).

In short, the output of df/diskutil is the one which is interesting if you bother about free space left, while du says you something meaningful if you bother about transfering files somewhere else. The difference "df-du" is basically non-usable space occupied due to the layout of your filesystem.

See for instance http://linuxshellaccount.blogspot.com/2008/12/why-du-and-df-... or any result for a web search "difference of du Vs df"