bug-coreutils
[Top][All Lists]
Advanced

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

bug#37702: Suggestion for 'df' utility


From: Erik Auerswald
Subject: bug#37702: Suggestion for 'df' utility
Date: Sat, 30 May 2020 13:49:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hi all,

On 30.05.20 05:18, Bryce Harrington wrote:
On Fri, Oct 11, 2019 at 12:56:20PM -0700, Paul Eggert wrote:
On 10/11/19 11:20 AM, Pádraig Brady wrote:

if you want to exclude nested file systems like that,
you could try:

    alias df='df -x squashfs'

On my Fedora 30 workstation that option doesn't make any difference.
Regardless of whether '-x squashfs' is used, I see this output from 'df':

Filesystem      1K-blocks      Used  Available Use% Mounted on
devtmpfs          4065704         0    4065704   0% /dev
tmpfs             4081560     36616    4044944   1% /dev/shm
tmpfs             4081560      1696    4079864   1% /run
tmpfs             4081560         0    4081560   0% /sys/fs/cgroup
/dev/sda5        59614116  16910684   39645412  30% /
tmpfs             4081560       124    4081436   1% /tmp
/dev/sda2      1849433716 207781976 1547682948  12% /home
/dev/sda1         5095040    244468    4572044   6% /boot
tmpfs              816312        60     816252   1% /run/user/1000

and most of these lines are useless.

In the above example, it seems useful to exclude tmpfs as well:

    alias df='df -x tmpfs -x squashfs'

That does remove the "useless" lines from df output on my Ubuntu 18.04
system, to be concrete.

What I do not like about this approach is the lack of an "unexclude"
option to add an excluded filesystem back in.  One could, e.g., use
\df to not use the alias, or use a different name for the alias (e.g.,
dfx), though.

I do remember a time when at least some distributions by default used
tmpfs for /tmp.  In that situation just this tmpfs filesystem should
probably not be excluded from the default df output.

For many years we've put up with the problem of too many filesystems in the
default plain 'df' output, and now's as good a time as any to fix that.
[...]
We can add a flag or two for the rare people who want to see these
normally-useless lines.
[...]
I'd like to help in fixing this issue.
[...]
I've taken a stab at a proof-of-concept implementation of #3, by adding
an environment variable DF_EXCLUDE_FSTYPES.
[...] > Further, even
with a config file users would probably want a cli switch and/or env var
to override the config file settings.

I concur that a command line option to override config file (or env var)
settings seems useful if a config file and/or env var approach is used.
Just as it seems useful to me to allow unsuppressing of output that has
been suppressed as useless by a possible new df default behavior.

HTH,
Erik





reply via email to

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