Sunday, December 13, 2009

Script for Finding Size of All Folders in Linux

Some users will eat lot of space in the system by storing unwanted files. This bash script will help you find which folder using more space.

Open a terminal
Then cut & Paste the script

for f in * ; do if [ -d "$f" ]; then du -sh "$f" ; fi done | sort -n

2 comments:

Magnus said...

du -h --max-depth=1

Jacob_oram said...

I am using this script
du -k --max-depth=1 | sort -n | cut -f2 | xargs -d '\n' du -sh