Forrest logo
back to the du tool

du:ai:02472

Show me the folder size of each subfolder in a directory on a alpine container
$ du -h ${directory} --max-depth=1 | sort -rh | awk '{print $2 " " $1}'
try on your machine

This command will display the sizes of all subfolders in the specified directory in human-readable format, with a max depth of 1 level. It will sort the output in descending order and print the folder name followed by its size in a JSON format.

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:

  • Show me the folder size of each subfolder in a directory on a alpine container?
back to the du tool