The “du” command

Use this command to estimate how much disk space each specified file or subdirectory uses.

Specify one or more individual files or sub-directories by including the complete path to the desired item as a “<FILE or SUBDIRECTORY>” variable. Separate each entry with a whitespace. Output will summarize each “<FILE or SUBDIRECTORY>” variable entry as disk usage in bytes.

Command format

du <OPTION>... <FILE or SUBDIRECTORY>...

Example usage

In this example, a subdirectory and a file are targeted, and the --max-depth=<#> option is incorporated to set the maximum sub-directory depth to four.

du --max-depth=4 /123456/test/movie1.mp4 /123456/test/primary

Available options

Note: NetStorage supports a limited set of options for this command. NetStorage doesn’t support command options not listed here.

The “<OPTION>” variable can be incorporated, using the following:

Option Description
--block-size=<size> Use a block size other than the default.
-f Include the number of files inside subdirectories.
-S, --separate-dirs Omit subdirectory sizes.
-s, --summarize Display totals for the specified file(s) and/or subdirectory(ies) only.
--max-depth=<#> Display totals for the specified file(s) and/or subdirectory(ies), and also for any subdirectories if they are within <#> sublevels of any specified directory.
-h, --help Display help information for this command.