how to check which directory is taking more space in linux code example Example: ubuntu du sort by dir size du -Sh /path/to/dir | sort -rh | head -20