Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How linux modifies the user to which the folder belongs

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how linux modifies the user to which the folder belongs". In the daily operation, I believe that many people have doubts about how linux modifies the user to which the folder belongs. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt that "linux how to modify the user to which the folder belongs". Next, please follow the editor to study!

In linux, you can use the chown command to modify the user to which the folder belongs, which is mainly used to modify the owner (user) of the file (or directory), with the syntax "chown [- R] owner file or directory".

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

In linux, you can use the chown command to modify the user to which the folder belongs.

The chown command, which can be thought of as an abbreviation for "change owner", is mainly used to modify the owner (or user) of the file (or directory).

Modify the basic format of the owner:

[root@localhost ~] # chown [- R] owner file or directory

The-R (note uppercase) option means that all files in the subdirectory are changed owners.

Example:

[root@localhost ~] # touch file# file file created by root user [root@localhost ~] # ll file-rw-r--r--. 1 root root 0 Apr 17 05:12 the owner of the file# file is root, and the ordinary user user has read-only access to this file [root@localhost ~] # chown user file# modify the owner of the file [root@localhost ~] # ll file-rw-r--r--. 1 user root 0 Apr 17 05:12 the file# owner becomes user, and the user user has read and write access to the file

As you can see, by changing the owner of the file file, the user user has changed from someone else (who only has read access to the file) to the owner, with read and write access to the file.

At this point, the study on "how linux modifies the user to which the folder belongs" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report