How to Change File Ownership in Linux (chown)
chown changes which user and group owns a file or directory.
Published October 1, 2026
chown changes which user and group owns a file or directory.
Key points
- chown user:group file.txt sets both the owning user and group in one command
- chown -R applies the ownership change recursively to a directory and everything inside it
- Only the root user (or a user with sudo) can change ownership to a different user
Example
sudo chown -R www-data:www-data /var/www/app