coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] filter ls output by filetype


From: Erik Auerswald
Subject: Re: [PATCH] filter ls output by filetype
Date: Thu, 28 Nov 2013 15:31:45 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Fri, Nov 29, 2013 at 12:49:19AM +1100, Hal Ashburner wrote:
> ls filters by filename - leading dot -a -A or --ignore pattern
> I have shell script that just shows directories by interposing `test`
> between two calls to ls in a pipeline to give me ls like behavior. Ls
> actually knows the filetype so I thought why not just filter on it in ls
> given filtering is something ls does? I noted this was not a rejected
> feature request and thought it might go well as a request accompanied by a
> patch.
> 
> --just
> was the best switch I could think of to achieve this end. I could easily be
> convinced there exists a better one. (--show-only? --showing?)

I don't like '--just' because it does not tell what this is about. One
might confuse it with something regarding (left- or right-) justification.

How about --list-type? I'd say the name should contain 'type' and
something to differentiate it from '--file-type'.

Anyway, ls --file-type | grep _might_ work most of the time, but would
become difficult with e.g. spaces or newlines in a file name, thus I'd
say this functionality looks useful.

Erik
-- 
One of the many strengths of Unix [...] is the principle of building
and then combining tools. Each tool should do one thing and do it well.
                        -- Neil Brown



reply via email to

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