News for hackers. Stuff that matters.
Re:Hacking ls -l by dredmorbius on Saturday October 13, 2012 @10:19PM (#4650384)
This.

I run into the situation more often with 'du' (when trying to find which subdirectory tree has excess junk in it), to the point that, while 'du -h' is human readable, it's not particularly sortable so:

    du -hs $( du -s * | sort -k1nr,1 -k2 | head )
.... which will return the human-readable output, based on numerically sorting the full numeric output. Eyeball comparisons are easier as you're aware that results are already sorted by size.
Re:Hacking ls -l by pwg on Saturday October 13, 2012 @11:11PM (#4650475)
A reasonably recent sort from GNU coreutils has a -h (and equivalent long option --human-numeric-sort) which properly sorts the output of du -h, meaning you can do:

du -h | sort -h

And get properly size-sorted output.

Re:Hacking ls -l by dredmorbius on Monday October 15, 2012 @02:26PM (#4656398)
TIL! Thanks.