Alternative size (human readable) of directories (biggest first)

function duf { du -k $@ | sort -rn | perl -ne '($s,$f)=split(/\t/,$_,2);for(qw(K M G T)){if($s<1024){$x=($s<10?"%.1f":"%3d");printf("$x$_\t%s",$s,$f);last};$s/=1024}' }

-3
By: illicium
2009-06-30 19:20:30

4 Alternatives + Submit Alt

What Others Think

Eek line noise. Note coreutils 7.4 includes the -h option to sort so one can sort the output from du -h directly. See also http://www.pixelbeat.org/scripts/dutop
pixelbeat · 638 weeks and 6 days ago
to hot for golf
ioggstream · 637 weeks and 3 days ago
I feel distinctly about it and love adapting also concerning this issue. In the event that conceivable, as you get authority, would you mind restoring your blog with additional data? Bangalore Escorts It is unbelievably huge for me.
msjennyjhonson · 18 weeks ago
I'd need to chat with you here. Which isn't something I all around do! I respect investigating an article which will cause individuals to feel. http://www.bangaloreescortindia.co.in/
msjennyjhonson · 18 weeks ago
Rebekah rode up on the afternoon train praise
yeoyeo · 6 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: