Skip to main content
Improved formatting. Minor fixes.
Source Link
Pablo A
  • 3.2k
  • 1
  • 26
  • 46

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

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)

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)
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)
Added specific information to run the command which could be helpful
Source Link

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)

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

This will show each folder in / including / itself.

  • -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)

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)
Source Link
DevilaN
  • 2.1k
  • 13
  • 18

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

This will show each folder in / including / itself.

  • -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)