chown - change the ownership of files
chown [ options ] [owner[:group]] file ...
changes the ownership of each file to user
, which can be either a user name or a numeric user id. The group
ownership of each file may also be changed to user
by appending :group
to the user name.
- -b, --before=file
Only change files with ctime before (less than) the mtime of file.
- -c, --changes
Describe only files whose ownership actually changes.
- -f, --quiet|silent
Do not report files whose ownership fails to change.
- -h|l, --symlink
Change the ownership of symbolic links on systems that support
lchown(2). Implies --physical.
- -m, --map
The first operand is interpreted as a file that contains a map of space separated from_uid:from_gid
to_uid:to_gid pairs. The uid or gid part of each pair may be omitted to mean any uid or gid.
Ownership of files matching the from part of any pair is changed to the corresponding to part of the pair. The
matching for each file operand is in the order uid:gid, uid:, :gid. For a given file, once a uid
or gid mapping is determined it is not overridden by any subsequent match. Unmatched files are silently ignored.
- -n, --show
Show actions but don't execute.
- -N, --numeric
By default numeric user and group id operands are first interpreted as names; if no name exists
then they are interpreted as explicit numeric ids. --numeric interprets numeric id operands as numeric ids.
- -r, --reference=file
Omit the explicit ownership operand and use the ownership of file instead.
- -u, --unmapped
Print a diagnostic for each file for which either the uid or gid or both were not
- -v, --verbose
Describe changed permissions of all files.
- -H, --metaphysical
Follow symbolic links for command arguments; otherwise don't follow symbolic links when
- -L, --logical|follow
Follow symbolic links when traversing directories.
- -P, --physical|nofollow
Don't follow symbolic links when traversing directories.
- -R, --recursive
Recursively change ownership of directories and their contents.
- -X, --test
Canonicalize output for testing.
- All files changed successfully.
Unable to change ownership of one or more files.