coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] ls: add --sort=width (-W) option to sort by filename width


From: Chris Elvidge
Subject: Re: [PATCH] ls: add --sort=width (-W) option to sort by filename width
Date: Sat, 17 Apr 2021 13:47:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 17/04/2021 12:50 pm, Pádraig Brady wrote:
On 16/04/2021 19:48, Kaz Kylheku (Coreutils) wrote:
On 2021-04-09 15:51, Pádraig Brady wrote:
On 09/04/2021 13:02, Carl Edquist wrote:
Dear Coreutils Maintainers,

I'd like to introduce my favorite 'ls' option, '-W', which I have been
enjoying using regularly over the last few years.

The concept is just to sort filenames by their printed widths.


(If this sounds odd, I invite you hear it out, try and see for
yourself!)


I am including a patch with my implementation and accompanying tests -
as
well as some sample output.  And I'll happily field any requests for
improvements.

I quite like this. It seems useful.
Also doing outside of ls is quite awkward,
especially considering multi column output.

Ah, but not so!

What is awkward is doing the sorting outside of ls, using only
the shell and utilities.

Thanks for taking the time to present these options.
It's useful both for the specific use case,
and the general approach to combining tools.

In this case we thought that doing this within the tool
was useful enough, and combining other tools awkward enough,
to warrant the new option.

What really swung it for me was combining this with other options.
For example `ls --sort=width -s` is a very compact view,
where one can also quickly visually scan for large files.

cheers,
Pádraig



While you're looking at this (achieving compact views) would it be possible for ls to ask the terminal what it's tab stops are set at rather than having to tell it manually?
I only found -T4 recently (must read more man pages).

--
Chris Elvidge
England




reply via email to

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