Linux Check Sub Folders Size and Files Amount

Linux Check Sub Folders Size

$ du -s ./* | sort -rn | head
1777328 ./catalog
1724096 ./upload
246476  ./order_attachment
16632   ./mgs_blog
12092   ./tmp
11528   ./wysiwyg
11476   ./mgs
3364    ./promobanners
2516    ./prx
1640    ./pub

Check first 3 sub folders according to sub folder sizes.

$ du -s ./* | sort -rn | head  -n 3
1777328 ./catalog
1724096 ./upload
246476  ./order_attachment

Linux Check Current Folder files amount

du -sh ./

Linux Check Sub Folders Files Amount

find . -maxdepth 1 -type d | while read dir; do count=$(find "$dir" -type f | wc -l); echo "$dir : $count"; done