NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ls(1) displays wrong file sizes



On Sat, 1 Oct 2011, Michael van Elst wrote:

ls -s would report allocated blocks, i.e. disk usage.

ls -sh is misleading, since it obviously reports file sizes,
not disk usage. I'm not sure if that is correct.

But interestingly, ls -lsh seems to do the right thing and count 512-octet blocks (as well as the file size).

The man page *does* state that the '-h' option "[causes] the sizes to be reported in bytes displayed in a human readable format" so depending on one's interpretation, this might be correct behaviour.

It's certainly surprising though...


MAgnus



Home | Main Index | Thread Index | Old Index