Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does linux change the folder owner

Shulou Source: shulou.com Published: 2022-05-31 15:06:40 10月05日 Update

This article mainly introduces how to change the folder owner of linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

In linux, you can use the chown command to change the folder owner, which is used to set the file owner and file association group, with the syntax "sudo chown owner name file name"; when you use chown to change the folder owner, you need to use administrator privileges, so precede the command with sudo.

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

How does linux change the folder owner

The owner of the file itself is generally the creator of the file, and of course we can modify it through commands. When the file creator creates the file, the creator's group is the file's group, of course, this is not absolute, we can also use the command to modify the group.

When using the chown command, you need to use administrator privileges. Add sudo before the command. As you can see, the file owner is changed to the user abc, and the file group is still zy. Chown means change owner.

The general format of the command is as follows

Sudo chown owner name file name

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

Linux/Unix is a multiuser and multiplex 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 list of files to change permissions separated by spaces, and wildcards are supported. .

Chown requires the privileges of superuser root to execute this command.

Thank you for reading this article carefully. I hope the article "how to change the folder owner of linux" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!

Tags: File command owner user folder location owner permission article creator name that is file name administrator system association support management operating system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Microsoft Shulou Information Linux