Beginner Package: coreutils

chown

Change the owning user (and optionally group) of a file.

Syntax

chown [options] user[:group] file

Description

chown transfers ownership of a file or directory to a different user, and optionally a different group at the same time, and typically requires root or sudo privileges.

Examples

chown alice file.txt
Change the owner of a file to user "alice"
chown alice:developers file.txt
Change both owner and group in one command
chown -R www-data:www-data /var/www/site
Recursively set ownership for a website's files

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux