In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will introduce in detail for you "Linux system how to view and modify file properties", the contents of the steps are clear and detailed, the details are handled properly, and the editor will update different knowledge points every day, hope that this article "Linux system how to view and modify file properties" can give you unexpected harvest, please follow the editor's ideas slowly in depth, the specific contents are as follows, to harvest new knowledge.
1. In Linux, we can use the ls-l command to display the properties of a file and the users and groups to which the file belongs.
Drwx- 3 admin admin 4096 Oct 20 20:55 admin drwxr-xr-x 2 root root 4096 Oct 21 18:47 liuqing drwx- 2 redis redis 4096 Oct 21 00:34 redis drwx- 3 www www 4096 Oct 21 00:33 www 123452. The first character in Linux: if it is [d], it is a directory, when it is [-], it is a file; if it is [l], it is represented as a linked document (link file); if it is [b], it is represented as a storage interface device in the device file (random access device). If [c] is expressed as a serial port device in the device file, such as keyboard and mouse (one-time reading device). In the following characters, a combination of three parameters, all of which are "rwx". Where [r] represents readable (read), [w] represents writable (write), and [x] represents executable (execute). It is important to note that the location of these three permissions will not change, if there are no permissions, there will be a minus sign [-].
In the real column, the first letter d in drwxr-xr-x 2 root root 4096 Oct 21 18:47 liuqing indicates that liuqing is a directory.
The last nine digits rwxr-xr-x are divided into three groups, which represent 1. Subordinate permissions: executable for read and write 2. Group permissions: readable, non-writable, executable 3. Other user rights: readable, non-writable, executable.
For a file, it has a specific owner, that is, the user who has ownership of the file. At the same time, in the Linux system, users are classified by groups, and a user belongs to one or more groups. Users other than the file owner can be divided into the same group of users and other users of the file owner. Therefore, the Linux system defines different file access permissions according to the file owner, the file owner, and other users. In the above example, the liuqing file is a directory file, and both the owner and the group are root.
Modify file attributes 1, chgrp: change the file belonging to the group
Chgrp-R belongs to the group name file name 1murr: recursively change the group of files, that is, when you change the group of a directory file, if you add the parameter of-R, then the group of all files in that directory will change. 2. Chown: change the file owner or change the file group at the same time
Chown-R generic name filename chown-R generic name: generic group name filename 123, chmod: change file 9 attributes when you don't have permission to manipulate this file! Permissions can be modified
There are two ways to set the properties of a chmod-R xyz file or directory 1Linux file, one is a number (usually a number), and the other is a symbol. There are nine basic permissions for Linux files, and each of the three owner/group/others identities has its own read/write/execute permissions. First review the data just mentioned: the permission character of the file is: "- rwxrwxrwx", these nine permissions are in groups of three! Among them, we can use numbers to represent each permission, and the comparison table of the scores of each permission is as follows: RRV 4 wv chomd 2 x RV 1 readable and non-executable rw- 6 Readable and non-executable rwx 7 chomd 777 file gives all users readable executable! The three r/w/x scores for each owner/group/others need to be accumulated, for example, when the permission is: [- rwxrwx-], the score is: owner = rwx = 4 "2" 1 = 7 group = rwx = 4 "2" 1 = 7 others=-= 0 "0"
What are the versions of chmod 770 filename chmod-R 770 filenameLinux the versions of Linux are: Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.
Thank you for reading here. The editor hopes that you will have the most profound experience from the practical level on the key issue of "how to view and modify file properties of the Linux system". The specific usage also requires everyone to practice and use it in order to understand it. If you want to read more related articles, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.