Hacker News new | past | comments | ask | show | jobs | submit login

It can also be achieved with some Perl:

    du -h | perl -e 'sub h{%h=(K=>10,M=>20,G=>30);($n,$u)=shift=~/([0-9.]+)(\D)/; return $n*2**$h{$u}}print sort{h($b)<=>h($a)}<>;'
Source: http://serverfault.com/a/62422/76878



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: