On 10/23/18 4:14 AM, David T-G wrote:
% % FWIW the later -h option overrides -k: ... % so 'df -kh' is identical to 'df -h'. ;-)
Thanks, and that's a fair point. The -k is ingrained because I use it everywhere, and I prefer the -h when it's available but not all flavors have it. Meanwhile, though, there are times when I want sort-able numbers and so no human-readable help and I drop the -h, but the -k stays.
Right, -h is a GNU extension which is not necessarily available in other implementations. WRT sorting: at least if you have GNU df, then you also have GNU sort which knows 'h'-sorting (since almost 10 years now, so not available e.g. on SLES11): $ df -h | sort -k2,2h Filesystem Size Used Avail Use% Mounted on /dev/loop0 31M 31M 0 100% /FULL_PARTITION_TMPDIR tmpfs 2.0G 24K 2.0G 1% /run/user/463 tmpfs 2.0G 48K 2.0G 1% /run/user/1000 devtmpfs 9.8G 8.0K 9.8G 1% /dev tmpfs 9.8G 0 9.8G 0% /sys/fs/cgroup tmpfs 9.8G 18M 9.8G 1% /run tmpfs 9.8G 55M 9.8G 1% /dev/shm /dev/sda2 20G 16G 3.5G 82% / /dev/sda3 99G 89G 4.4G 96% /home /dev/sda5 591G 293G 298G 50% /media/big_data ;-) Admittedly, I use it more often with 'du', e.g.: $ du -hcx -d3 --threshold=+1G / | sort -h 1.1G /lib/modules 1.4G /lib 1.5G /var/tmp/build-root 2.8G /usr/lib64 3.1G /usr/share 3.3G /var/tmp 4.9G /var 8.3G /usr 15G / 15G total Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org