[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7042: df --help does not show `-m' option
From: |
Paul Eggert |
Subject: |
bug#7042: df --help does not show `-m' option |
Date: |
Thu, 16 Sep 2010 15:34:24 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100826 Thunderbird/3.0.7 |
On 09/16/10 11:21, Eric Blake wrote:
> document -m, with --block-size=M as the long-option spelling
> add -g, with --block-size=G as the long-option spelling
This doesn't sound like a good idea. Multi-terabyte disks
are already here, and "df -t" is already taken. Also,
"df -g" already means something different in Solaris.
Is it really that hard to type "df -Bg"?
If we're going to make incompatible changes, I suggest that
we solve the problem once and for all, by having "df" choose
the default blocksize dynamically, based on the size of the
output line describing the smallest disk. For example, where
"df" currently outputs this:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 11620338002 1437021 11618900981 1% /r/opt
/dev/sda2 20971520 1335871 19635650 7% /home/eggert
"df" would notice that the smallest file system is between 1GB and 1TB,
so it would default to 1 GB blocks, as follows:
Filesystem 1GB-blocks Used Available Use% Mounted on
/dev/sda1 11900GB 2GB 11898GB 1% /r/opt
/dev/sda2 22GB 2GB 21GB 7% /home/eggert
This is much more useful as an output format, because one can visually
see which file systems are larger by seeing how many digits are there.
Contrast this to the output of df --si:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 12T 1.5G 12T 1% /r/opt
/dev/sda2 22G 1.4G 21G 7% /home/eggert
which is harder to visually parse that way.
While we're at it, we should fix "df" so that its columns line up better;
that would be another incompatible change, but it'd be worth it
on hosts where the file system names are long.
bug#7042: df --help does not show `-m' option, Eric Blake, 2010/09/16