File Permissions

chown

Change file owner and group ownership.

Synopsis

syntax
chown [OPTION]... [OWNER][:GROUP] FILE...

Examples

Change owner and group
sudo chown user:group file.txt
Recursively set web server ownership
sudo chown -R www-data:www-data /var/www
Change group only
sudo chown :developers project/
Copy ownership from reference
sudo chown --reference=ref.txt target.txt

Common options

FlagDescription
-ROperate recursively
-vVerbose output
-cReport only changes
--referenceCopy ownership from reference file
-hAffect symlinks instead of targets

About chown

The `chown` command change file owner and group ownership. File permission commands control access to files and directories on Linux.

The Unix permission model uses owner, group, and other categories with read, write, and execute bits. Properly managing permissions is essential for system security, multi-user environments, and running services that require specific access levels.

The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man chown`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More File Permissions Commands

Other commands in the File Permissions category

Related tools