Name
chown — stdin stdout - file -- opt --help --version
Synopsis
chown [options]user_spec files
The chown (change owner)
command sets the ownership of files and directories. To make user
smith the owner of several files
and a directory, run:
# chown smith myfile myfile2 mydir
The user_spec parameter may be any
of these possibilities:
A username (or numeric user ID), to set the owner:
chown smith myfileA username (or numeric user ID), optionally followed by a colon and a group name (or numeric group ID), to set the owner and group:
chown smith:users myfileA username (or numeric user ID) followed by a colon, to set the owner and to set the group to the invoking user’s login group:
chown smith: myfileA group name (or numeric group ID) preceded by a colon, to set the group only:
chown :users myfile--reference=fileto set the same owner and group as another given file
Useful options
|
|
Follow symbolic links and operate on the files they point to. |
|
|
Recursively change the ownership within a directory hierarchy. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access