Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Documentation/applications/nsh/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,51 @@ Also sets the previous working directory environment variable
``cd ..`` sets the current working directory to the parent directory.
================== =====================================

.. _cmdchmod:

``chmod`` Change File Permissions
==================================

**Command Syntax**::

chmod <octal-mode> <path>

**Synopsis**. Change the permission bits of ``<path>``. Only numeric
(octal) modes are supported.

**Example**::

nsh> chmod 600 /tmp/secret
nsh> chmod 755 /usr/bin/app

.. _cmdchown:

``chown`` Change File Owner and Group
======================================

**Command Syntax**::

chown <uid>[:gid] <path>

**Synopsis**. Change the owner and/or group of ``<path>``. Only
numeric uid and gid values are accepted. Omitted uid or gid fields
are left unchanged.

**Forms:**

=================== ===============================================================
``chown uid:gid`` Sets owner to uid and group to gid.
``chown uid`` Sets owner to uid; group is unchanged.
``chown uid:`` Sets owner to uid; group is unchanged.
``chown :gid`` Sets group to gid; owner is unchanged.
=================== ===============================================================

**Example**::

nsh> chown 1000:1000 /tmp/file
nsh> chown 0: /tmp/file
nsh> chown :100 /tmp/file

.. _cmdcmp:

``cmp`` Compare Files
Expand Down