man.lsPlain-English help for Unix commands

chown Change file owner and group

Changes which user and group own a file or folder. You use it when files end up owned by the wrong account, for example after copying them with sudo or restoring a backup. Most changes need super user rights, so it is usually run with sudo.

Synopsis

chown [-fhnvx] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhnvx] [-R [-H | -L | -P]] :group file ...

Common options

Option or formWhat it does
-RChange a folder and everything inside it. Use with care
-hIf the target is a symbolic link, change the link itself instead of the file it points to
-vVerbose: show each file as its owner is changed. Repeat it (-vv) for old and new numeric IDs
-fDo not report failures, and do not reflect them in the exit status
-nTreat the owner and group as numeric IDs and skip name lookups
-H, -L, -PWith -R, choose how symbolic links are treated: -H follows links named on the command line, -L follows all links, -P follows none (the default)
-xWith -R, do not cross into other mounted file systems

Examples

Give a file to a different user (needs sudo)
sudo chown alice report.pdf
Change the owner and the group together
sudo chown alice:staff report.pdf
Change only the group (note the leading colon)
sudo chown :staff report.pdf
Take back ownership of a project folder you own by mistake-as-root
sudo chown -R "$USER" ~/projects/myapp
Show what is being changed
sudo chown -v alice:staff report.pdf

Notes

See also

Last reviewed 2026-10-07.