bug-findutils
[Top][All Lists]
Advanced

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

Documentation question (correction?) for -ls: 1K vs 1 byte block size


From: Peggy Russell
Subject: Documentation question (correction?) for -ls: 1K vs 1 byte block size
Date: Mon, 16 May 2011 02:21:54 -0500
User-agent: KMail/1.12.4 (Linux/2.6.31.12-0.2-desktop; KDE/4.3.5; x86_64; ; )

Hi,

I came across something in the `find` documentation while trying GNU 
commands with SI Decimal (--SI) and IEC Binary Prefixes (--human-readable).

The ACTION `-ls` says it reports the size in 1K blocks. From reading the
info page on "Block Size", it looks more like `find -ls` is reporting the
size in 1 byte blocks.  See Command output #1 and #3 verses #6 and #7.

From: man:find 
............................................................................
-ls    True; list current file in ls -dils format on standard output.  
       The block counts are  of 1K  blocks....
............................................................................
Similar text is in info:find. However, when itemizing each field of the
output the text correctly states bytes ("7. The file's size in bytes.").

From: info:/coreutils/Block size
............................................................................
If none of the above environment variables are set, the block size currently 
defaults to 1024 bytes in most contexts, but this number may change in the 
future. For `ls' file sizes, the block size defaults to 1 byte.
............................................................................

Commands:
............................................................................
  #1 find -maxdepth 1 -name out -ls
  58933524   12 -rw-rw-r--   1 user group       10000 May 13 17:19 ./out

  #2 ls -dils out
  58933524 12 -rw-rw-r-- 1 user group 10000 2011-05-13 17:19 out

  #3 ls -l --block-size=1 out
  -rw-rw-r-- 1 user group 10000 2011-05-13 17:19 out

  #4 ls -l out
  -rw-rw-r-- 1 user group 10000 2011-05-13 17:19 out

  #5 wc -c out
  10000 out

  #6 ls -l --block-size=1K out
  -rw-rw-r-- 1 user group 10 2011-05-13 17:19 out

  #7 ls -lk out
  -rw-rw-r-- 1 user group 10 2011-05-13 17:19 out
............................................................................

Thank you.
Peggy Russell



reply via email to

[Prev in Thread] Current Thread [Next in Thread]