GNU bug report logs -
#49994
upgrade: have "-s" of 'ls' display alloc'd sizes for specified "--block-size"
Previous Next
Full log
Message #43 received at 49994 <at> debbugs.gnu.org (full text, mbox):
On 8/20/21 12:02 AM, L A Walsh wrote:
> When I use "-b" in du (equivalent to '--apparent-size --block-size=1)
Previously in this thread you asked for "allocated space for a file on a
device", which is why I was talking about that number.
Now you're asking for apparent size, which is a different number. If you
want apparent size, you can use 'ls -l', or follow Andreas's suggestion
and use something like 'stat -c "%s %n"'. However, apparent size might
be quite different from allocated space, as can be seen in the 1st and
6th columns of the last two lines of the following:
$ echo '' >a
$ truncate -s 1TB b; echo '' >>b
$ ls -ls --block-size=1 a b
4096 -rw-rw-r-- 1 eggert eggert 1 Aug 20 08:07 a
4096 -rw-rw-r-- 1 eggert eggert 1000000000001 Aug 20 08:07 b
This bug report was last modified 3 years and 302 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.