Quick Tip: Sort by directory size

February 14, 2009

[ linux  ]

If you’ve got files hidden around your system and you don’t know where they are, you can use a quick command to track them down and sort them with the largest first. Handy when trying to prune your old files or free up space on your hard disk.

Try this:

$ sudo du --max-depth=1 /home/ | sort -n -rs