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

Re: df -h shows insufficient precision



On Sun, Aug 26, 2018 at 03:04:38PM +1000, Zenaan Harkness wrote:
> On Sat, Aug 25, 2018 at 10:38:19PM -0400, Roberto C. Sánchez wrote:
> > On Sun, Aug 26, 2018 at 12:25:44PM +1000, Zenaan Harkness wrote:
> > > A regular itchy annoyance for years now:
> > > 
> > > df shows bytes, df -h shows only one decimal place, so e.g. on a
> > > 1.8TiB drive "1.6T" is the free space, but that resolution/ precision
> > > is insufficient. Of course I can fire up bc, set scale=20 and do some
> > > powers of 1024 division, but that's all very clunky.
> > > 
> > > How hard would it be to add an option to bc, to choose the number of
> > > decimal places to use in the output, or the number of digits of
> > > precision to display?
> > > 
> > 
> > Have you looked at the -k and -B options?  Also, di has the -d option
> 
> I assume you mean "du"?
> 
> Unfortunately the du command recursively scans directories - not a
> quick option when all you want is a summary for the drive/ partition.
> 
> > which is more flexible and it also supports format strings.  You should
> > be able to make it produce output in exactly the way you need.
> 
> Thank you - I do use du from time to time, but it's just too slow for
> whole-drive (or partition) "quick" checks...
> 

No.  I actually meant 'di':

$ apt-cache show di
Package: di
Source: di (4.34-2)
Version: 4.34-2+b1
Installed-Size: 105
Maintainer: Michael Ablassmeier <abi@debian.org>
Architecture: amd64
Depends: libc6 (>= 2.3)
Description-en: advanced df like disk information utility
 `di' is a disk information utility, displaying everything
 (and more) that your `df' command does. It features the
 ability to display your disk usage in whatever format you
 desire/prefer/are used to. It is designed to be portable
 across many platforms.

Regards,

-Roberto
-- 
Roberto C. Sánchez


Reply to: