Ubuntu – How to sort folders by actual size, instead of amount of sub-folders or files

directoryfilessort

I am pretty new with Ubuntu, so take it easy on me.

enter image description here

This is the "problem" (feature?) that I'm experiencing. It sorts by amount of folders and files, not by the actual file size.

I want to know much much of disk space certain folders use, not how many sub-folders/files it contains. Any way to do this? For simplicity's sake, is there any way to do this using the Unity GUI ? Or is terminal the only way?

Best Answer

At least there is a GUI tool called baobab which you pretty sure have to install. I am sure there are more GUI tools out there. Just use your favorite search engine to find others.

On the command line, there is ncdu which does the job you want. Otherwise you could use plain command line tools like follows.

du -h --max-depth=1 <folder-to-check> | sort -h
du -h --max-depth=1 /etc/ | sort -h

I think all of them will output files and directories.

Related Question