The chown
command makes it possible to change the ownership of a file or directory. Users and groups are fundamental in Linux, with chown
you can
change the owner of a file or directory. It's also possible to change ownership on folders recursively
- Change the owner of a file
chown user file.txt
- Change the group of a file
chown :group file.txt
- Change the user and group in one line
chown user:group file.txt
- Change to ownership on a folder recursively
chown -R user:group folder
chown [-OPTION] [DIRECTORY_PATH]