Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 2006 10:42:59 -0800
From:      Bakul Shah <bakul@bitblocks.com>
To:        freebsd-arch@FreeBSD.ORG
Subject:   Re: New option for ls(1), du(1), df(1) 
Message-ID:  <20061124184259.246945B1E@mail.bitblocks.com>
In-Reply-To: Your message of "Fri, 24 Nov 2006 18:40:13 %2B0100." <200611241740.kAOHeDHB072173@lurza.secnetix.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Fromme writes:
...
> I've hacked a new option into those tools which uses
> thousands separators for displaying the numbers.  With
> that option, the output looks like this (in US locale):
> 
> Filesystem    1K-blocks      Used       Avail Capacity  Mounted on
> /dev/ad0s1a   1,012,974    62,418     869,520     7%    /
> /dev/ad0s1d  10,154,158    31,474   9,310,352     0%    /var
> /dev/ad0s1e  10,154,158 1,545,718   7,796,108    17%    /usr
> /dev/ad0s1f 128,009,212 1,358,600 116,409,876     1%    /home
> /dev/md0        297,326        20     273,520     0%    /tmp

...

Rather than add more code to quite a few programs I just use
a separate program since this is useful in many places.

$ df | hunit
Filesystem      1K-blocks     Used   Avail Capacity  Mounted on
/dev/ad0s3a         99,183    66,198   25,051    73%    /
devfs                   1        1       0   100%    /dev
/dev/ad0s3e        190,167    29,468  145,486    17%    /var
/dev/ad0s3f      61,147,922 54,629,382 1,626,708    97%    /usr

Granted, columns don't line up right but that too belongs in
a separate program.

> It is also worth noting that probably many more tools
> might benefit from that feature.  "netstat -i" and
> "ipfw show" come to mind immediately.

Which is why a separate program is nicer.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061124184259.246945B1E>