How do I get the size of a Linux or Mac OS X directory from the command-line?
Problem
What command do I use to find the size of all the files (recursively) in a Linux or Mac OS X directory?
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: How do I get the size of a Linux or Mac OS X directory from the command-line?
The BSD version of used in OS X reports size with 512-byte blocks -- the sizes are essentially rounded up to the next 512-byte value. This tells you the space on disk, which is larger than the amount of data. If you have a lot of small files, the difference can be large. Here's an example. This is the value with regular . It's in 512-byte blocks: The flag results in a more readable number, in kilobytes. As expected, it's half the number of 512-byte blocks: Finally, you can use and to give you t…
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix