chown

Change file or directory ownership (user and/or group).

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
getfacl -R <path> > /tmp/acl.backupBack up ownership and ACLs.
find <path> -user <old> -exec chown <new> {} +Change only files owned by a specific user.
What it does

chown changes the owner and/or group of files. Format is user:group. Either can be omitted — chown user: changes owner and group to user's primary group; chown :group changes only the group.

Common flags
FlagMeaning
-R --recursiveChange ownership recursively
-v --verbosePrint a message for each changed file
--referenceUse a reference file's ownership
Examples
chown nginx:nginx /var/www/htmlSet web root to nginx user and group · explain & risk-check →
chown -R deploy:deploy /opt/appRecursively set ownership for app directory · explain & risk-check →
chown root:root /usr/local/bin/myscriptSet ownership to root · explain & risk-check →
chown --reference=/etc/passwd /etc/shadowMatch ownership from reference file · explain & risk-check →
Pro tip

Use `chown user:` (trailing colon, no group) to change the user and automatically set group to that user's primary group — saves a lookup step.

Related
chmod stat ls
Open the full explainer →More in Users, Permissions & Security

Reference text is hand-written and may be incomplete — check man chown for your version. Test destructive commands on a non-production system first.