chown <user> <file>Changes the owner.
Example
sudo chown alice report.txtChanges the owner and group of files and directories.
sudo apt install coreutilschown <user> <file>Changes the owner.
Example
sudo chown alice report.txtchown <user>:<group> <file>Changes owner and group together.
Example
sudo chown www-data:www-data index.phpchown :<group> <file>Changes only the group (same as chgrp).
Example
sudo chown :developers app.pychown <user>: <file>Sets the owner and the owner’s login group.
Example
sudo chown bob: notes.txtchown -R <user>:<group> <dir>Changes ownership recursively.
Example
sudo chown -R www-data:www-data /var/www/sitechown -v <user> <file>Prints every change.
chown -h <user> <link>Changes the symbolic link itself rather than its target.
chown --reference=<ref> <file>Copies ownership from another file (GNU).
Example
sudo chown --reference=/var/www /var/www/newchown <uid>:<gid> <file>Numeric IDs, useful in containers where names do not match.
Example
sudo chown 1001:1001 data/chgrp <group> <file>Changes only the group.
Example
sudo chgrp adm /var/log/app.logChanges file permissions using symbolic or octal modes, including setuid, setgid and sticky bits.
Lists directory contents with sizes, permissions, owners, timestamps and hidden files.
Switches to another user (root by default) in a new shell, optionally as a login shell or for a single command.