
Ask HN: How do you check for free space on your lap-top? - Azisk
I have these 2 aliases to check the free space and the size of folders on my Mac
alias space=&#x27;diskutil info &#x2F;dev&#x2F;disk1 | grep &quot;Volume Free Space&quot;&#x27;
alias size=&#x27;du -h -d 1&#x27;
======
ktpsns
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-...](http://linuxshellaccount.blogspot.com/2008/12/why-du-and-df-display-
different-values.html?m=1) or any result for a web search "difference of du Vs
df"

