Red Hat Bugzilla – Bug 153109
ls has improper documentation
Last modified: 2007-11-30 17:11:03 EST
Description of problem:
When you type ls -- help, it shows the following:
" -s, --size print size of each file, in blocks"
Instead it should show:
" -s, --size print disk space used by file on file system, in
"ls -s" doesn't show the actual size of the file, but the number of blocks taken
up on disk. Therefore, it's expected if a block is 4K and the file is 1K, then
it will return 4K (if you use the -h option).
The issue is that if you use the --block-size parameter, it shows (disk space
used)/(block size specified), not (file size)/(block size specified), which is
what we'd assume based on the description.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
ls --help shows "print size of each file, in blocks" for -s
ls --help shows "print disk space used by file on file system, in blocks"
Since this is an issue for all distributions, it should be changed upstream.
This bug was reported by someone else on the Debian bug site
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=116358 and the argument given
by the Debian developer was not valid because he said he wouldn't change the
description of --block-size in the help listing, but that description isn't the
problem... The issue is that the description for -s needs to be changed.
The word "size" here is slightly ambiguous, but the fact that the units are
"blocks" is a big clue about what the quantity being shown really represents.
FWIW, the info page is absolutely clear.
Not worth patching IMHO. Take it up with the upstream authors if you wish.