This is an automated email from the ASF dual-hosted git repository.
linguini1 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 cea3a33ae7b Documentation: Document tee command.
cea3a33ae7b is described below
commit cea3a33ae7ba61ca75daa8af446eff5a4af38996
Author: hanzhijian <[email protected]>
AuthorDate: Tue May 26 17:10:14 2026 +0800
Documentation: Document tee command.
Add the missing application reference for the tee system command. The
page now documents the command purpose, build configuration, usage,
options, arguments, examples, and error behavior using the implementation
in apps/system/tee as source evidence.
Signed-off-by: hanzhijian <[email protected]>
---
Documentation/applications/system/tee/index.rst | 82 +++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/Documentation/applications/system/tee/index.rst
b/Documentation/applications/system/tee/index.rst
index 6c8b55ce65b..08a9a6ebbc7 100644
--- a/Documentation/applications/system/tee/index.rst
+++ b/Documentation/applications/system/tee/index.rst
@@ -1,3 +1,85 @@
===================
``tee`` Tee Command
===================
+
+Overview
+========
+
+The ``tee`` command copies standard input to standard output and to each
+specified file. It is useful in scripts or command pipelines when output
+needs to be displayed and saved at the same time.
+
+When no files are specified, ``tee`` copies standard input to standard
+output only.
+
+Configuration
+=============
+
+Enable the application with ``CONFIG_SYSTEM_TEE``.
+
+The task priority and stack size are controlled by:
+
+- ``CONFIG_SYSTEM_TEE_PRIORITY``
+- ``CONFIG_SYSTEM_TEE_STACKSIZE``
+
+Usage
+=====
+
+.. code-block:: console
+
+ tee [-a] [file ...]
+ tee -h
+
+Options
+=======
+
+.. list-table::
+ :header-rows: 1
+
+ * - Option
+ - Description
+ * - ``-a``
+ - Append to each output file instead of truncating it.
+ * - ``-h``
+ - Show command usage and exit.
+
+Arguments
+=========
+
+``file``
+ Optional output file. Any number of files may be specified. Output is
+ written to standard output in addition to each named file.
+
+Examples
+========
+
+Copy input to standard output and save it in ``output.txt``:
+
+.. code-block:: console
+
+ nsh> echo "hello" | tee output.txt
+ hello
+
+Append input to an existing log file while also displaying it:
+
+.. code-block:: console
+
+ nsh> echo "next line" | tee -a log.txt
+ next line
+
+Copy input to more than one file:
+
+.. code-block:: console
+
+ nsh> echo "sample" | tee first.txt second.txt
+ sample
+
+Notes
+=====
+
+The command opens each named file for writing. Without ``-a``, existing
+files are truncated; with ``-a``, output is appended. Files that do not
+already exist are created with mode ``0644``.
+
+If opening an output file, reading from standard input, or writing to an
+output destination fails, the command exits with failure status.