". Generally, only the root user can use this command."/> ". Generally, only the root user can use this command.">

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-04-27 11:36:076839browse

What is the command to change file owner in linux

In Linux, you can use the chown command to change the owner of the specified file to the specified user or group. The user can be the user name or user ID; the group can be the group name or group ID; File is a space-separated list of files whose permissions need to be changed. Wildcards are supported.

Command syntax:

chown [-R] 所有者名称 文件或者目录

-R: Make recursive and continuous changes. That is to say, all files and directories under the subdirectory are updated to become this user group. It is often used to change the status of all files in a certain directory.

Example:

[root@shuai shan]# ls -al
-rw-r--r--  1 root root    0 8月  19 12:37 six.log
[root@shuai shan]# chown shan six.log
[root@shuai shan]# ls -al
-rw-r--r--  1 shan shan    0 8月  19 12:37 six.log

Recommended learning:Linux video tutorial

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