coreutils
[Top][All Lists]
Advanced

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

Re: ls enhancement


From: Bob Proulx
Subject: Re: ls enhancement
Date: Fri, 16 Jan 2015 15:31:33 -0700
User-agent: Mutt/1.5.23 (2014-03-12)

LxC wrote:
> Pádraig Brady wrote:
> >LxC wrote:
> >>I was astonished that Linux dir/ls could not count files/dirs like DOS
> >>and implemented it myself month ago.

Astonished?  I am astonished that you are astonished! :-)

> >>It's now indispensable for me and maybe useful for others too?

I think it is each to their own.  This seems like a useful command for
those that want it but I don't think combining du and ls is a good
thing to do globally.

> >If we were to add it, it would have to be an option to turn it on.
> 
> please do it! a little hack for you and me. a big step for coreutils ;-)

> 3997 0 /home/lxc $ \ls -l /usr
> total 272
> drwxrwxr-x   2 root root   73728 Jan 12 00:31 bin
> drwxr-xr-x   2 root root    4096 Jan  4 22:35 games
> drwxr-xr-x 110 root root   36864 Jan  4 21:55 include
> drwxrwxr-x 271 root root  106496 Jan  6 00:05 lib
> drwxr-xr-x   3 root root    4096 Dec 12  2011 lib64
> drwxrwsr-x  13 root staff   4096 Oct 20 22:51 local
> drwxr-xr-x   2 root root   20480 Jan 12 02:23 sbin
> drwxrwxr-x 437 root root   16384 Jan 12 01:39 share
> drwxr-xr-x   8 root root    4096 Aug 12  2013 src
>   0 Files  0 Links  9 Dirs  -  270.336 (0) Bytes

I don't see the advantage.  The 270.336 (0) Bytes is a repeat of
information presented above it in "total 272" for one thing.
Personally I think the summary line is quite unattractive.  It
certainly couldn't be the default or it would break those people and
scripts that don't expect it there.

> 3998 0 /home/lxc $ \ls -lR /usr|tail

I see that command and it scares me.  That would take a long time to
run on most of my machines.  It is data dependent depending upon what
is there.  Running 'ls -lR /var' would take an extremely long time on
most of my systems.  I could only recommend against it.

  time ls -lR /usr > /dev/null
  ...
  real    3m8.663s
  user    0m2.724s
  sys     0m6.548s

> 3998 0 /home/lxc $ \ls -lR /usr|tail
> ...
>   45 Files  1 Link  0 Dirs  -  185.669 (185.631) Bytes
>   168.440 Files  29.257 Links  20.822 Dirs  #  6.053.652.735 (5.962.597.158) 
> Bytes

Sorry but that doesn't convince me into wanting to use it.

> >TBH it does seem to munge functionality from du and wc.
> 
> for this wc and du are suboptimal.

Everything is suboptimal for everyone other than the original author.
But if we implemented everything for everyone it would be awful for
everyone and no one would benefit.

> I want this infos _exactly, _completely and _instantly!

It certainly is not instant in the recursive case.

That exact formatting seems very arbitrary.  And quite ugly in my
eyes.  Different people will want different output formats.  If you
are wanting something very specific then it is best if you create
something for yourself that handles that specific case.  That is the
joy of free(dom) software that enables you that ability.  You have the
software and you have created a tool perfect for yourself.  That is
wonderful.

I think this is a feature creep that isn't good to have in 'ls'.  I
would vote against it.  *If*, and I am not suggesting it, then if it
were added I could maybe see it being added to the 'dir' command.
Since it seems to me that 'dir' exists as a DOS compatibility layer.
Making the 'dir' command look more like the old DOS dir command could
have some merit.

Bob



reply via email to

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