On 03/01/2012 10:38 AM, Pádraig Brady wrote: > On 03/01/2012 06:41 AM, Jari Aalto wrote: >> >> 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 > > I wouldn't say that's very hard to read at all. > We've addressed the specific uuid case above anyway. > >> >> In a smaller terminal the lines wrap, which makes it even harder: > > Well that's not the common case, nor is it common to have > naturally long "Filesystem" items. > For these uncommon cases you could just use a pager like: > > df | less -S > >> 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. > >> (2) Also add option to reverse the output to see the values first (most >> important) in a full display: >> >> -r, --reverse > > I'm not that enthusiastic about these new options.
To expand a bit on why I'm not enthusiastic. Well mainly I don't see a pressing need for them. Generally one has large terminals these days, and with `less -S` you can scroll left/right anyway. If we were adding this option I wouldn't call it --reverse, since it might be confused with item order, rather than field order. Also the field order isn't even reversed, just the first and last swapped. I can't think of a good name, maybe --paths-last or something. Bernard's --format would be more generally useful and I'd be happier with something like that. Again it's borderline though. Also just swapping the fields doesn't address the line wrapping issue which is by far the most problematic issue for readability. Well one advantage to putting paths at the end, is the wrapping would be minimised to just long lines rather than all lines. For me this is much the same though, as once I see any wrapping I rerun through a pager or whatever. cheers, Pádraig.