Permissions & SecurityCLI Reference
$chown
Change file owner and group attributes.
Syntax DefinitionPOSIX standard
chown [OPTIONS] OWNER[:GROUP] FILE...Try `chown` Live in Interactive Sandbox
Zero-install client simulation with real-time feedback.
bash — terminal
AST Sandbox (Free)
Overview & How chown Works
`chown` (Change Owner) alters the user ownership and group association of files, directories, and links. System administrators frequently use `chown` when deploying web applications or restoring user permissions after file migrations.
Common Flags & Command Options
| Flag / Option | Description |
|---|---|
| -R | Recursively change ownership of directories and all contents. |
| -v | Verbose output reporting every ownership change executed. |
| -c | Report only when an actual change is made. |
Practical Real-World Examples
Example #1Change owner of a file to user
chown user /var/log/syslog && ls -l /var/log/syslogAssigns user ownership to the system syslog file and checks with ls.
Sample Output:
-rw-r--r-- 1 user root 2048 Aug 28 10:14 /var/log/syslogFrequently Asked Questions
Can regular non-root users transfer file ownership with chown?
On most Linux systems, only the root superuser can transfer file ownership to another user for security isolation.