@eliza_fixes
Linux Oct 16, 2026

getting the total size of a folder in the terminal

ls only shows file sizes, not the size of a whole directory with everything inside it. I need to know which folders in my home directory are eating the disk on my Ubuntu laptop. What's the command for that?
1

Leave A Reply

Log in to post an answer.

1 Answer

sambyte Oct 20, 2026
eliza_fixes
du -sh foldername -s gives one total instead of listing every file, -h makes it read in K/M/G. If you want to see which subfolders are the big ones: du -sh foldername/* | sort -h