Skip to content

Instantly share code, notes, and snippets.

@ezarko
Created October 22, 2015 22:00
Show Gist options
  • Save ezarko/ff34e3592583512139a9 to your computer and use it in GitHub Desktop.
Save ezarko/ff34e3592583512139a9 to your computer and use it in GitHub Desktop.
List out the children of a directory in descending size order
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