Finder shows the wrong file size compared to Terminal or e.g. Gmail (not the base-10 vs base-2 problem)

filesystemfinderterminal

Finder shows different sizes for my files as compared to Terminal

Finder

-rw-r--r--@ 1 yuku  staff   4576265 Aug  6  2014 af-afr.yet
-rw-r--r--@ 1 yuku  staff   1804227 Aug 11  2014 alp-alune5.yet
-rw-r--r--@ 1 yuku  staff   8348051 Jul 24  2015 ar-nav.yet
-rw-r--r--@ 1 yuku  wheel   4683564 May  8  2015 ar-vandyke.yet
-rw-r--r--@ 1 yuku  staff   1169397 Aug  6  2014 arc-pst.yet
-rw-r--r--@ 1 yuku  staff   2545947 Aug  6  2014 awa-awbtc.yet

You can see the difference is very significant (e.g. 6 MB vs 4576265 bytes). The one at Terminal is the correct one, since if I open the files with Sublime Text and count the bytes, or attach the files in Gmail, they will show the same sizes as the Terminal ones.

If I open the file Info window, it shows the wrong size as well.

Info

This has been months, even after rebooting. I am using macOS 10.13 High Sierra. Do you know what is the source of this error and how to fix it?

Best Answer

Actually, the answer is in your "Get Info" window:

GetInfo Size

You've got compression enabled on that drive. The file does have 6MB data in it, and when you copy it elsewhere, that's what it takes up.

However, with compression enabled on that drive, the file only takes up 2.9MB on the disk because it has been compressed.