Created
October 22, 2015 22:00
-
-
Save ezarko/ff34e3592583512139a9 to your computer and use it in GitHub Desktop.
List out the children of a directory in descending size order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -shx * | perl -e '%x=qw/K 1000 M 1000000 G 1000000000/;print sort {$a=~/^(\d+(?:\.\d+)?)([KMG])\s/ or die $a;my@a=($1,$2);$b=~/^(\d+(?:\.\d+)?)([KMG])\s/ or die $b;my@b=($1,$2);$b[0]*$x{$b[1]} <=> $a[0]*$x{$a[1]}} <>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment