Sort directories by size in Linux

Posted: August 27, 2012 in Linux
Tags:

The command is quite simple.

du –max-depth=1 /the/parent/directory/ | sort -n -r

The result will be as below

100000 ./subdir1/

90000 ./subdir2/

….

….

If the result is too long, just append | more to the above command.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s