CHOWN(1) General Commands Manual CHOWN(1)

chown, chgrpChange 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.

If file is a symbolic link, set it's ownership.
If -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.
If -R is also specified, and symbolic links referring to directories are found, change ownership of said directories and their children.
If -R is also specified, change ownership of symbolic links without dereferencing.
Recurse into directories.
ref_file
Copy ownership from ref_file into each file.
Verbose, print a message about each processed file, whether a change was made or not.

The chown utility exits 0 on success, and >0 if an error occurs.

stat(1)

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