Why would files show zero size in Terminal by multiple KB in Finder? I have a folder of font files that are ~30KB in size each. Finder shows this information correctly, but when I go to Terminal, it shows the files as each having a size of 0KB.



ls -ltarh
total 1008
-rwx------@  1 danrumney  staff     0B Jun  4  2002 GothaBol
-rwx------@  1 danrumney  staff     0B Jun  4  2002 GothaLigIta
-rwx------@  1 danrumney  staff     0B Jun  4  2002 GothaLig
-rwx------@  1 danrumney  staff     0B Jun  5  2002 GothaMedIta
-rwx------@  1 danrumney  staff     0B Jun  5  2002 GothaMed
-rwx------@  1 danrumney  staff     0B Mar 31  2003 HTF Gotham™
-rwx------@  1 danrumney  staff     0B Feb  5  2006 Gotham-Bold
-rwx------@  1 danrumney  staff     0B Feb  5  2006 Gotham-Medium
-rwx------@  1 danrumney  staff     0B Jun 17  2009 Gotham-Ultra
-rwx------@  1 danrumney  staff     0B Jun 17  2009 Gotham-Book
-rwx------@  1 danrumney  staff     0B Jun 17  2009 GothaUlt
-rwx------@  1 danrumney  staff     0B Jun 17  2009 GothaBoo
-rw-r--r--@  1 danrumney  staff   6.0K Mar 14 12:24 .DS_Store
drwxr-xr-x@ 12 danrumney  staff   384B Mar 17 09:50 ..
drwxr-xr-x@ 15 danrumney  staff   480B Mar 17 09:50 .


There are plenty of questions and answers around Finder showing different sizes to the Terminal, but in those, the Terminal tends to be the correct one - this appears to be the opposite.

Why the discrepancy here?
My guess would be that the content of those files are hidden away in the resource fork, and that ls only shows the size of what’s visible to standard Unix API:s.

If this is the case, you should be able to see the “hidden” bytes by doing

ls -l *filename*/..namedfork/rsrc