Forrest logo
back to the du tool


du: List the human-readable sizes of a directory and of all the files and directories within it.
$ du -ah ${path-to-directory}
try on your machine

The command "du -ah ${path-to-directory}" is used to calculate the disk usage of files and directories within a specified directory.

  • "du" stands for "disk usage" and is the command used to estimate file and directory sizes.
  • "-a" option is used to display all files and directories, including hidden ones.
  • "-h" option is used to display the output in a human-readable format, such as "K" for kilobytes, "M" for megabytes, etc.
  • "${path-to-directory}" is the placeholder for the actual path to the directory you want to analyze. You need to replace it with the specific directory path for which you want to calculate disk usage.

By running this command, you will get a list of files and directories within the specified directory along with their sizes in a human-readable 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.
back to the du tool