Understanding permissions on I nodes and Recursion
Source: Internet
Author: User
For more information about I node and recursive permission understanding-general Linux technology-Linux technology and application, see the following. [I = s] This post was last edited by xiadao_81
A few days ago, I wrote a post on http://www.linuxdiyf.com/bbs/thread-171802-1-1.html, where I talked about permission limitations. A good friend sent me a text message explaining the shortcomings, mainly about modifying or overwriting a file. I think it makes sense. Thank you very much, this is very helpful for us to learn.
In the message he mentioned I node, so I also looked for relevant information, such as http://www.linuxdiyf.com/bbs/vie... light = I % BD % DA % B5 % E3. As a newbie, I don't know much about it. Hope you can talk about it: I node in linux, then, we use recursive methods to understand the permission-related issues. Thank you!
Because the previous text message is missing for some reason, only the last record is left as follows:
3. Let's see if you can edit it:
[Us1 @ localhost contrib] $ vi exmple.txt
When I switch to the insert status, the following message is displayed:
-- Insert -- W10: Warning: modifying a read-only file
I did not care about it. I continued the write operation, added two lines of files, and finally: wq! Save and exit. OK.
Let's look at the file again:
[Us1 @ localhost contrib] $ ll
Total 16
-Rw-r -- 1 music 11 01-08 10:43 exmple. bak
-Rw-r -- 1 us1 us1 29 01-08 10:52 exmple.txt
The ownership of the file exmple.txt has changed to us1.
Because chownis a Super User command in linux, the original exmple.txt is not modified, but overwritten. A directory in Linux can be viewed as a special file, including its own permissions, a list of file names, specific points, and other information. Take a look at the information about the I node. Then, we use recursive methods to understand the permissions.
I Node
In UNIX systems, an inode structure is used to store management information of various levels in the file system. I nodes reside on the hard disk and do not have their own names, but have the number of indexes to point to their locations in the I node array.
Each I node usually includes:
Location of the content of the data entry on the disk
Type of the data entry (file, directory, symbolic connection, etc)
Number of bytes of the data entry
The last time the node was modified (ctime)
The last time (mtime) when the file was modified)
Last time the file was accessed (atime)
Number of file names corresponding to this file (connections)
UID
GID
MODE bit
If you encounter any mistakes during learning, you can correct them. If you wait for the future, it will be wrong! Learn together! I'm not ashamed to ask! At the same time, I would like to give some experience to people who want to learn linux like me!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service