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: L A Walsh <coreutils <at> tlinx.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
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 12:57:03 -0700

On 2021/08/20 11:31, Paul Eggert wrote:
> On 8/20/21 10:40 AM, L A Walsh wrote:
>>      I wanted it just to work
> 
> So use 'stat -c "%s %n"'. That works just fine. 'stat' is a good tool 
> for this job, and there's no need for yet another 'ls' option for this 
> rare use case.

stat doesn't come close.
I wanted the automatic-multi column output of 'ls' like "ls -s" gives, 
but instead of the disk-space-allocated number as 'du' would be
sufficient for, I wanted 'byte' output -- like the default output of 'ls'
gives.

By default, ls gives you names, or with -l gives you bytes.  If you want
a short form that gives you bytes+name, the obvious attempt would be
use of -s with a flag that would say to display bytes.

This rare use case? Having a file-list command that 
displays filename+size in a compact form seems one of the
top use use-cases.  Yet that seems to be missing.

The default of ls -s should be to display size, not allocated blocks, since
if you want that, 'du' is what first comes to mind to find the
diskspace-used.





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.