chown [options] owner[:group] file...Arguments explained
- owner is the target user.
- group is optional after a colon.
- -R applies recursively.
Common examples
sudo chown -R alex:alex /srv/appMakes alex the owner and group for the app directory tree.
sudo chown www-data index.htmlSets the owner while leaving group unchanged.
| Field | Details |
|---|---|
| Command | chown |
| Category | Permissions and Ownership |
| Primary use | Changes file owner and optionally group. |
| Syntax | chown [options] owner[:group] file... |