This is an automated email from the ASF dual-hosted git repository.

simbit18 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 609528dabb5 Documentation: add du command to NSH commands reference
609528dabb5 is described below

commit 609528dabb53f7b84fc54d9b7ef5515b778c3e97
Author: Junbo Zheng <[email protected]>
AuthorDate: Thu Jul 23 23:20:43 2026 +0800

    Documentation: add du command to NSH commands reference
    
    Add a reference section for the NSH `du` command, covering the -h,
    -s, -a, and -d N options, default-to-current-directory behavior,
    and an example showing recursive directory output.
    
    Options are rendered as an RST simple table to match the style of
    other NSH command sections (ls, umount, uptime). Sizes are noted as
    apparent sizes (st_size) and -h as integer-arithmetic, one-decimal
    output that needs no float printf support.
    
    Signed-off-by: Junbo Zheng <[email protected]>
---
 Documentation/applications/nsh/commands.rst | 41 +++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

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] <path>...
+
+**Synopsis**. Recursively summarize the apparent size of each
+``<path>`` in 1K-blocks, or in human-readable form with ``-h``. If
+no ``<path>`` 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 ``<path>``.
+``-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

Reply via email to