Note to self: how to see folder size under linux?

i personally like CLI because just a few key strokes and i will get what i need. But i am bad at remembering the optiosn and commands... so this will be a note-to-self post, while hopefully it might also be helpful to you

to see folder size, the simplest way i know is to use du:

wahlau@localhost:~/ $  du

and you will get a long list of folders and the number of kilobytes of the data in the folders. so make it more "readable", just do this:

wahlau@localhost:~/ $  du --si

and you will get them in M or G, which corresponds to MBs and GBs.

i personally don't really need to see all the folders. So i use this:

wahlau@localhost:~/ $  du --si --max-depth=1

to just see the size of the subfolders of my current directory, and if i need to see two levels of subfolders, i will just set max-depth to 2.

To specifically display subfolder sizes of only /some/specific/folder/? no problem:

wahlau@localhost:~/ $  du --si /some/specific/folder/

these are all i need. If i want something graphical, i would go for Baobab. But du does the job most of the time.