Forrest logo
back to the tree tool

tree:tldr:65245

tree: Print the size of each file and the cumulative size of each directory, in human-readable format.
$ tree -s -h --du
try on your machine

The command "tree -s -h --du" is used to display a directory tree with some additional information.

Here is what each option in the command does:

  • "tree": This is the main command that generates the directory tree.

  • "-s" or "--si" or "--du": This option displays the file and directory sizes in a human-readable format using the SI units (e.g., KB, MB, GB, etc.) or in the case of "--du", using the disk usage units (1K = 1024 bytes).

  • "-h" or "--human-readable": This option makes the sizes more human-readable by using unit prefixes (e.g., K, M, G) instead of just showing the number of bytes.

  • "--du": This option displays the disk usage (i.e., the amount of space files occupy on disk) instead of just the apparent size.

By combining these options, the "tree -s -h --du" command provides a directory tree where the sizes of files and directories are displayed in a human-readable format, and the disk usage of files is also shown.

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.
back to the tree tool