Forrest logo
back to the du tool

files:directory:sort:size

List all folders and order them by size.
$ du -h --max-depth=1 | sort -hr
try on your machine

This command lists all folders in the current directory by size, displayed in human-readable format (-h). The folders are sorted in descending order using the 'sort' command with 'h' option to support human-readable numbers and 'r' option for reverse order.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • how do i list all folders in by size?
back to the du tool