Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 taking refuge in the Monastery: (7)
As of 2015-07-05 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls