#The command to change the file owner in Linux is the chown command.
The chown command is used to change the owner of a file, that is, the owner of the specified file is changed to another specified user or group.
(Recommended tutorial: linux tutorial)
Command format:
chown [选项]... [用户][:[组]] 文件...
Example:
sudo chown book:book /work -R
Parameter introduction:
-R[recursion]: Recursively change all files in the directory;
Let’s check the results after the change:
Enter the ls -ld work command, It can be seen that the permissions of the work directory are managed by book, so that book users can write and read files.
As shown:
The above is the detailed content of What is the command to change file owner in linux. For more information, please follow other related articles on the PHP Chinese website!