Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: du -h, sorted

by hbm (Hermit)
on Feb 25, 2009 at 23:09 UTC ( #746401=note: print w/ replies, xml ) Need Help??


in reply to Re: du -h, sorted
in thread du -h, sorted

I like your subtle omission of parens from h$a, versus h($b). But to sort correctly, I tweaked slightly to use the OP's 10,20,30 values.

perl -e 'sub h{pop=~/(...)(.)/&&$1*2**{K,10,M,20,G,30}->{$2}}print sor +t{h($b)<=>h$a}`du -h`'


Comment on Re^2: du -h, sorted
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://746401]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2015-04-25 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (477 votes), past polls