chown
Options
--help
-
chown-help-print-help
--changes
,-c
-
chown-help-changes
--from=<CURRENT_OWNER:CURRENT_GROUP>
-
chown-help-from
--preserve-root
-
chown-help-preserve-root
--no-preserve-root
-
chown-help-no-preserve-root
--quiet
-
chown-help-quiet
--recursive
,-R
-
chown-help-recursive
--reference=<RFILE>
-
chown-help-reference
--silent
,-f
--verbose
,-v
-
chown-help-verbose
-H
-
if a command line argument is a symbolic link to a directory, traverse it
-L
-
traverse every symbolic link to a directory encountered
-P
-
do not traverse any symbolic links (default)
--dereference
-
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
--no-dereference
,-h
-
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
Examples
Change the owner user of a file/directory:
chown {{user}} {{path/to/file_or_directory}}
Change the owner user and group of a file/directory:
chown {{user}}:{{group}} {{path/to/file_or_directory}}
Change the owner user and group to both have the name user
:
chown {{user}}: {{path/to/file_or_directory}}
Recursively change the owner of a directory and its contents:
chown {{[-R|--recursive]}} {{user}} {{path/to/directory}}
Change the owner of a symbolic link:
chown {{[-h|--no-dereference]}} {{user}} {{path/to/symlink}}
Change the owner of a file/directory to match a reference file:
chown --reference {{path/to/reference_file}} {{path/to/file_or_directory}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.