bug-coreutils
[Top][All Lists]
Advanced

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

bug#49994: upgrade: have "-s" of 'ls' display alloc'd sizes for specifie


From: L A Walsh
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
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)



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.






reply via email to

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