Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was having a look at the size of libBLAS.dylib at some location in my Mac and du showed it's file size as 572K while the allocated file size (showed by Finder) was 1.4MB. I've read that the lack of sparse files on HFS+ can cause this discrepancy.

My question is that why would a compiled shared library need to be sparse - after all, it's not like anything is going to be modifying it.

share|improve this question
Wonder if it could be that du counts files in 512-byte blocks, while the Finder counts them in 4096-byte blocks due to HFS+? – gosmond Feb 25 '13 at 8:49
Then the difference should be 4K at most, not more than 0.8MB – Opt Feb 25 '13 at 9:12
Is your question why there is a difference in the reported size, or why this file needs to be a sparse file? – Gerry Feb 25 '13 at 9:30
The former but I'm guessing that's going to involve some explanation of the latter? – Opt Feb 25 '13 at 19:00

Difference is in units they use.

du uses BLOCKSIZE=4096 bytes by default (rounded if Human Readable format option -h i.e. df -h) Finder uses BLOCKSIZE=1000 by default

$du -h /usr/lib/libblas.dylib 
4.0K    /usr/lib/libblas.dylib

and same in Finder.

share|improve this answer
Can you describe how this explains the "factor 2" difference in size reported by the asker? – patrix Mar 7 '13 at 8:21
df -h and df -k gives same results – Eir Nym Mar 7 '13 at 8:32
I hope they do! But how do you explain the difference to the size reported by Finder? – patrix Mar 7 '13 at 8:43
I've explained how Finder says same as du – Eir Nym Mar 7 '13 at 8:46
@EirNym In the answer (if I understand correctly), you state that using du -h should give the same result as the file size in Finder. However, I tried running du -h to get the file size of my home folder and it doesn't match the file size Finder reports. (Finder: 122.13G, du:161G) – Arc676 Oct 3 '14 at 4:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.