Using "Linux Find" command to get human readable directory sizes in public_html

Submitted by Anonymous (not verified) on Tue, 04/27/2010 - 14:52

Say you have 100 top level directories and 1000 files just under ../public_html/ without counting deeper located files and dirs. and you want to get an overview of dirs under your www-directory. You can do it with one line command.

Use find to find directories, set maxdept to just get top-level folders.

Combine it with -exec and get same time the disk usage of dirs.

Use -h for human readable file sizes GB, MB, KB instead of byte size.

find /home/YOUR_USERNAME/public_html/ -type d -maxdepth 1 -exec du -sh {} \;