How do I sort folders by actual size, instead of amount of sub-folders or files

10,890

Solution 1

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.

Solution 2

As mentioned by Thomas in his answer, you should use Disk Usage Analyzer app, aka Baobab. The default file manager, Nautilus, doesn't have a setting for displaying directory usage in bytes.

Command-line alternative to that would be ncdu , which you can get with sudo apt-get install ncdu enter image description here

Solution 3

Great GUI tool called Baobab (aka Disk Usage Analyzer). I am especially in love with the interactive radial maps, which do a wonderful job at showing percent of usage per folder and sub-folder trees. Takes only seconds to drill down and see where those space hogs are.

To install

sudo apt-get install baobab 

To run

gksu baobab

If running on an encrypted drive, scan that particular one by going to the main page and then pressing the three lines in the upper right corner and choosing the sub-file (like home if it is encrypted).

Share:
10,890

Related videos on Youtube

Nephilim
Author by

Nephilim

Updated on September 18, 2022

Comments

  • Nephilim
    Nephilim over 1 year

    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?

  • Nephilim
    Nephilim over 7 years
    It seems like it was already installed on my version. Thank you.
  • Hee Jin
    Hee Jin almost 6 years
    It would be great if you could share more about why you prefer Baobab to other options that are out there!
  • izk9
    izk9 almost 6 years
    Great suggestion Emily. I'll add some to my answer.
  • Hee Jin
    Hee Jin almost 6 years
    Nice additions to your answer—thank you for sharing, it is incredibly helpful!
  • Pandurang Patil
    Pandurang Patil almost 4 years
    Perfect solution