I face disk space full issue in Linux. When checked with df command I found the '/' directory is occupying 100%. So to check which folders consume much space I ran cd / and du -sh. But it takes forever to run the command. But ultimately I want to get the details on which top immediate sub folders of '/' folder are consuming huge disk space. So can any one tell the command for the same.

6 Answers 6


du -h --max-depth=1 / | sort -h -r

This will show each folder in / including / itself.

Mind that this could take a long time to scan through all the files. If you require any specific sizes of the subfolders in a folder, specify the exact path of the folder instead of / or just skip / if you're already in that folder.

  • -h options shows sizes in human friendly format
  • --max-depth=1 instructs command to go only 1 directory deep inside /
  • sort -h -r sorts results using human friendly sizes and -r instructs command to show results in reverse order (from largest to smallest directories)
  • Here is osx version: du -h -d 1 / | sort -h -r
    – crollywood
    Commented Mar 23, 2022 at 15:37

This command will list the 15 largest in order:

du -xhS | sort -h | tail -n15

We use the -x flag to skip directories on separate file systems.

The -h on the du gives the output in human readable format, sort -h can then arrange this in order.

The -S on the du command means the size of subdirectories is excluded.

You can change the number of the tail to see less or more. Super handy command.


Two other open source command line tools, that display top disk space used, are:

ncdu : available in the repo of most Linux distributions.

Top Disk Usage (tdu) : A single static binary with no dependencies, written in Golang.

enter image description here

  • Wow, this is so much easier. Thanks so much for sharing this. Commented Jun 6, 2020 at 15:57

I allways use

cd /
du -sch ./*

This will show you all folders from the root folder and their used disk space.

After getting the usage from all parent directories, change in the next child folder and repeat the 'du' command from above. Repeat that stepts to find your big files and folders.

You need to go from folder to folder to find out whats going on.

Edit: May be you want the "x" flag as well if you have multiple partions mounted. The 'x' will only count usage on one filesystem and exclude other mounts.

du -schx ./*

The command du -hs /* will list all top directories seperatly.


The following command worked for me:

# du -xh -d 1| sort -h 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .