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

What is the command to change file owner in linux

王林
Release: 2020-06-24 09:21:07
Original
15528 people have browsed it

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 [选项]... [用户][:[组]] 文件...
Copy after login

Example:

sudo chown book:book /work -R
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template