Subject: 8.13: df -- overly long output lines are very hard to read

From: Jari Aalto <[email-masked]>
Date: Thu, 01 Mar 2012 01:41:18 -0500

With long path names, the output is very hard to read because each line is
so long:

    $ df -Hl

    Filesystem                                              Size  Used Avail Use% Mounted on
    rootfs                                                  6.0G  4.1G  1.7G  72% /
    udev                                                    192M     0  192M   0% /dev
    tmpfs                                                    40M  1.5M   38M   4% /run
    /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627  6.0G  4.1G  1.7G  72% /
    tmpfs                                                   5.3M     0  5.3M   0% /run/lock
    tmpfs                                                    79M  7.9M   71M  10% /tmp
    tmpfs                                                    79M     0   79M   0% /run/shm
    /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627  6.0G  4.1G  1.7G  72% /srv/cante.src
    /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627  6.0G  4.1G  1.7G  72% /srv/cante.tmp
    /dev/sdb1                                                18G  8.1G  8.3G  50% /mnt/extent
    /dev/sdb1                                                18G  8.1G  8.3G  50% /usr/src
    /dev/sdb1                                                18G  8.1G  8.3G  50% /root/vc

In a smaller terminal the lines wrap, which makes it even harder:

    Filesystem                                              Size  Used Avail Use% M\
    ounted on
    rootfs                                                  6.0G  4.1G  1.7G  72% /
    udev                                                    192M     0  192M   0% /d\
    ev
    tmpfs                                                    40M  1.5M   38M   4% /r\
    un
    /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627  6.0G  4.1G  1.7G  72% /
    tmpfs                                                   5.3M     0  5.3M   0% /r\
    un/lock
    tmpfs                                                    79M  7.9M   71M  10% /t\
    mp
    tmpfs                                                    79M     0   79M   0% /r\
    un/shm
    /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627  6.0G  4.1G  1.7G  72% /s\
    rv/cante.src
    /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627  6.0G  4.1G  1.7G  72% /s\
    rv/cante.tmp
    /dev/sdb1                                                18G  8.1G  8.3G  50% /m\
    nt/extent
    /dev/sdb1                                                18G  8.1G  8.3G  50% /u\
    sr/src
    /dev/sdb1                                                18G  8.1G  8.3G  50% /r\
    oot/vc

SUGGESTIONS

(1) Add exclude to option to filter out items from the display, thus
calculating the line-up column better.

        -X, --exclude PATTERN

    Where patterns could be preferably EREGEXP (best), or in the initial
    implementation a simple STRING to match.

    df -HlX by-uuid

    $ df -Hl

    Filesystem      Size  Used Avail Use% Mounted on
    rootfs          6.0G  4.1G  1.7G  72% /
    udev            192M     0  192M   0% /dev
    tmpfs            40M  1.5M   38M   4% /run
    tmpfs           5.3M     0  5.3M   0% /run/lock
    tmpfs            79M  7.9M   71M  10% /tmp
    tmpfs            79M     0   79M   0% /run/shm
    /dev/sdb1        18G  8.1G  8.3G  50% /mnt/extent
    /dev/sdb1        18G  8.1G  8.3G  50% /usr/src
    /dev/sdb1        18G  8.1G  8.3G  50% /root/vc

(2) Also add option to reverse the output to see the values first (most
important) in a full display:

        -r, --reverse

    $ df -Hlr

    Size  Used Avail Use% Mounted-on Filesystem
    6.0G  4.1G  1.7G  72% /             rootfs
    192M     0  192M   0% /dev          udev
     40M  1.5M   38M   4% /run          tmpfs
    6.0G  4.1G  1.7G  72% /             /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627
    5.3M     0  5.3M   0% /run/lock     tmpfs
     79M  7.9M   71M  10% /tmp          tmpfs
     79M     0   79M   0% /run/shm      tmpfs
    6.0G  4.1G  1.7G  72% /srv/cante.src /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627
    6.0G  4.1G  1.7G  72% /srv/cante.tmp /dev/disk/by-uuid/492764a5-7506-4489-8fd0-82d0d284d627
     18G  8.1G  8.3G  50% /mnt/extent   /dev/sdb1
     18G  8.1G  8.3G  50% /usr/src      /dev/sdb1
     18G  8.1G  8.3G  50% /root/vc      /dev/sdb1