GNU bug report logs - #49994
upgrade: have "-s" of 'ls' display alloc'd sizes for specified "--block-size"

Previous Next

Package: coreutils;

Reported by: L A Walsh <coreutils <at> tlinx.org>

Date: Wed, 11 Aug 2021 06:58:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: L A Walsh <coreutils <at> tlinx.org>
Cc: 49994 <at> debbugs.gnu.org
Subject: bug#49994: upgrade: have "-s" of 'ls' display alloc'd sizes for specified "--block-size"
Date: Fri, 20 Aug 2021 08:08:13 -0700
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 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.