chown - Change file owner and group
chown [--help] [-c|--changes] [--from] [--preserve-root] [--no-preserve-root] [--quiet] [-R|--recursive] [--reference] [-f|--silent] [-v|--verbose] [-H ] [-L ] [-P ] [--dereference] [-h|--no-dereference] [-V|--version]
Change file owner and group
Print help information.
like verbose but report only when a change is made
<CURRENT_OWNER:CURRENT_GROUP>change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute
fail to operate recursively on /
do not treat / specially (the default)
suppress most error messages
operate on files and directories recursively
<RFILE>use RFILEs owner and group rather than specifying OWNER:GROUP values
output a diagnostic for every file processed
if a command line argument is a symbolic link to a directory, traverse it
traverse every symbolic link to a directory encountered
do not traverse any symbolic links (default)
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
Print version
v(uutils coreutils) 0.10.0
Change the owner user of a file/directory:
sudo chown user path/to/file_or_directory
Change the owner user and group of a file/directory:
sudo chown user:group path/to/file_or_directory
Change the owner user and group to both have the name `user`:
sudo chown user: path/to/file_or_directory
Change the group of a file to a group that the current user belongs to:
chown :group path/to/file_or_directory
Recursively change the owner of a directory and its contents:
sudo chown [-R|--recursive] user path/to/directory
Change the owner of a symbolic link:
sudo chown [-h|--no-dereference] user path/to/symlink
Change the owner of a file/directory to match a reference file:
sudo chown --reference path/to/reference_file path/to/file_or_directory
The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.