Home  >  Article  >  Operation and Maintenance  >  What is the command to change file owner in linux

What is the command to change file owner in linux

王林
王林Original
2020-06-24 09:21:0715419browse

What is the command to change file owner in linux

#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:

What is the command to change file owner in linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is a Linux image?Next article:What is a Linux image?