Re: df -h listing
Rick Pasotto <rick@niof.net> writes:
>> I think you missed someting? like the -n flag? If you do a normal sort,
>> its alphabetic. With -n, it is done numeric.
>
> That's true but it doesn't help anyway. 57K will sort larger than 2M.
You could do it in two stages, first without -h, to sort, then with -h,
to display... e.g.:
df -h `df | tail -n +2 | sort -n -k2 | awk '{print $NF}'`
Sample output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 3.8G 3.3G 282M 93% /usr
tmpfs 253M 16K 253M 1% /dev/shm
tmpfs 253M 0 253M 0% /lib/init/rw
/dev/sda1 137M 79M 52M 61% /
udev 10M 28K 10M 1% /dev
[You might want to use the "-xtmpfs" option with the inner df, 'cause
tmpfs filesystems look sort of weird in a sorted list like this...]
-Miles
--
My spirit felt washed. With blood. [Eli Shin, on "The Passion of the Christ"]
Reply to: