[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ls enhancement
From: |
Pádraig Brady |
Subject: |
Re: ls enhancement |
Date: |
Wed, 14 Jan 2015 19:35:22 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 14/01/15 10:58, address@hidden wrote:
> Hello!
>
> I was astonished that Linux dir/ls could not count files/dirs like DOS
> and implemented it myself month ago.
>
> It's now indispensable for me and maybe useful for others too?
>
> Example:
>
> 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
>
> 3998 0 /home/lxc $ \ls -lR /usr|tail
> -rw-rw-rw- 1 root root 285 May 21 1999 tile.cc
> -rw-rw-rw- 1 root root 1372 Jan 10 2000 tile.hh
> -rw-rw-rw- 1 root root 2482 Oct 5 2002 tileset.cc
> -rw-rw-rw- 1 root root 1671 Jan 27 2003 tileset.hh
> -rw-rw-rw- 1 root root 8771 Oct 5 2002 traverse.cc
> -rw-rw-rw- 1 root root 1079 Jan 27 2003 traverse.hh
> -rw-rw-rw- 1 root root 8438 Oct 5 2002 xmj3ts.cc
> -rw-rw-rw- 1 root root 1136 Aug 29 2003 xmj3ts.hh
> 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
>
> 3999 0 /home/lxc $ ls --help
> ...
> -J, --no-journal in a long listing, do not add up files and
> dirs
> ...
>
>
> -J to switch it off
> () is pure file size
>
> It's easy, but I can supply my little dirty ls.diff for version 8.xx.
If we were to add it, it would have to be an option to turn it on.
TBH it does seem to munge functionality from du and wc.
Personally I rarely need to see disk usage in an ls listing,
and if I do it's for individual files, which is supported with -s.
If I want further disk usage coalescing handling hardlinks etc. I use du.
thanks,
Pádraig.
- ls enhancement, linuxCowboy, 2015/01/14
- Re: ls enhancement,
Pádraig Brady <=