April 15, 2014 - rob

find what folder is using up the most disk space

du -ks $(ls -d */) | sort -nr | cut -f2 | xargs -d ‘\n’ du -sh 2> /dev/null

There are other commands like:

du -h –max-depth=1

du -h | sort -h -r


To find what files are taking up the most space:

find . -type f -print0 | xargs -0 du -h | sort -hr | head -20

find . -printf ‘%s %p\n’|sort -nr|head



Leave a Reply