Find the largest directories sorted by disk space

Use the du command to list firectories with largest disk space. Replace DIREC in the following commands with a starting directory (e.g; / or /etc)

# du -sh $DIREC/* | sort -r --human-numeric-sort | head -n10

In the above command, head -n10 option can be changed to list few or more results in the output.

Another example is given below.

# du -sh /* | sort -r --human-numeric-sort | head -n10

Leave a Reply