Linux.com

Re:Beware using "-h" with "du" and passing to "sor

Posted by: Anonymous Coward on December 13, 2005 04:04 AM
du -sk * | sort -n | perl -ne '($s,$n)=split(m{\t});for (qw(B KB MB GB)) {if($s1024) {print "$s$_\t$n"; last};$s=$s/1024}'

will fix this, FYI. I did not come up with this myself, i got this off of a IRC.

#

Return to CLI Magic: Daily aliases