diff --git a/Documentation/applications/nsh/commands.rst b/Documentation/applications/nsh/commands.rst index dc8559d4417..8e4c933db07 100644 --- a/Documentation/applications/nsh/commands.rst +++ b/Documentation/applications/nsh/commands.rst @@ -431,6 +431,47 @@ that in-memory, circular buffer to the NSH console output. ``dmesg`` has the side effect of clearing the buffered data so that entering ``dmesg`` again will show only newly buffered data. +.. _cmddu: + +``du`` Estimate File Space Usage +================================ + +**Command Syntax**:: + + du [-h] [-s] [-a] [-d N] ... + +**Synopsis**. Recursively summarize the apparent size of each +```` in 1K-blocks, or in human-readable form with ``-h``. If +no ```` is given, the current working directory is used. As +an example:: + + nsh> du + 397449 /data/test/elf + 71993 /data/test/coredump + 5 /data/test/log2 + 3251 /data/test/log1 + 472700 /data/test + nsh> du -h + 388.1M /data/test/elf + 70.3M /data/test/coredump + 4.1K /data/test/log2 + 3.1M /data/test/log1 + 461.6M /data/test + nsh> + +**Options** + +======== =========================================================== +``-s`` Summary only: print only the total for each ````. +``-a`` List all files, not only directories. +``-d N`` Print at most N directory depth levels. +``-h`` Human-readable sizes (K/M/G, one decimal; ``B`` below 1K). +======== =========================================================== + +Sizes are apparent sizes (``st_size``), not block usage. ``-h`` +prints one decimal using integer arithmetic and does not require +float printf support. + .. _cmdecho: ``echo`` Echo Strings and Variables