How to change folder owner in linux

WBOY
Release: 2021-12-31 16:11:55
Original
43382 people have browsed it

In Linux, you can use the chown command to change the folder owner. This command is used to set the file owner and file association group. The syntax is "sudo chown owner name file name"; use chown to change the file. When folder owner, administrator rights are required, so sudo must be added before the command.

How to change folder owner in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to change the folder owner in Linux

The owner of the file itself is generally the file creator. Of course, we can modify it through commands. . When the file creator creates a file, the group the creator belongs to is the group the file belongs to. Of course, this is not absolute. We can also modify the group through commands.

How to change folder owner in linux

#When using the chown command, you need to use administrator privileges. Add sudo before the command. You can see that after changing the file owner to user abc, the group of the file is still zy. chown means change owner.

The general format of the command is as follows

sudo chown 拥有者名字 文件名
Copy after login

The Linux chown (English full spelling: change owner) command is used to set the file owner and file association group.

Linux/Unix is a multi-person, multi-tasking operating system, and all files have owners. Use chown 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. The file is a space-separated list of files whose permissions need to be changed. Wildcards are supported. .

chown requires super user root permissions to execute this command.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to change folder 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!