CHOWN(1) | General Commands Manual | CHOWN(1) |
chown
, chgrp
— Change files ownership
chown |
[-v ] [-h |
-R [-HLP ]]
owner[:group]
file... |
chown |
[-v ] [-h |
-R [-HLP ]]
--reference ref_file
file... |
chgrp |
[-v ] [-h |
-R [-HLP ]]
group file... |
chgrp |
[-v ] [-h |
-R [-HLP ]]
--reference ref_file
file... |
chown
sets the user ID given by
owner, and when given by group,
the group ID on each given file.
chgrp
sets the group ID given by
group on each given file.
The owner and group arguments can be either numeric IDs, or names. Unless specified, ownership refers to both user and group.
If --reference
is used instead
chown
sets both user and group ownership and
chmod
sets only group ownership.
-h
-H
-R
is also specified, and
file refers to a symbolic link itself referring to a
directory, change ownership of the directory and it's children.-L
-R
is also specified, and symbolic links
referring to directories are found, change ownership of said directories
and their children.-P
-R
is also specified, change ownership of
symbolic links without dereferencing.-R
--reference
ref_file-v
The chown
utility exits 0 on
success, and >0 if an error occurs.
chown
should be compliant with the IEEE
Std 1003.1-2024 (“POSIX.1”) specification.
The -v
and
--reference
options are extensions, also present in
GNU coreutils.
Support for --reference
was added in
utils-std 0.0.5.
Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
October 31, 2024 | Linux |