Linux index nodes and values (essential), and linux index nodes

Source: Internet
Author: User

Linux index nodes and values (essential), and linux index nodes

Audience,

[Root @ luozhonghua aaa] # ls-l test. c

-Rw-r --. 1Root 3 Aug 1 test. c # check that the index node value of the original test. c file in bold 1 is 1, that is, each file is unique when it is generated for the first time.
[Root @ luozhonghua aaa] # ln test. c test1.c # Hard link file test1.c
[Root @ luozhonghua aaa] # ls-li test *
262594-rw-r --. 2Root 3 Aug 1 07:49 test1.c

262594-rw-r --.2Root 3 Aug 1 07:49 test. c # Why does it change to 2 here? It is because the hard link is automatically increased by 1. In fact, it is easy to understand that the linux File System is the structure of a tree node.

# Check again. If I delete test. c, check it out.

[Root @ luozhonghua aaa] # rm-rf test. c
[Root @ luozhonghua aaa] # ls-li test *
262594-rw-r --.1Root 3 Aug 1 test1.c # changed back. Note that this value remains unchanged in many documents, or 2, which is incorrect.


All in all, linux is a tree node system consisting of Tree node files. operating all files is the same as the logic of the tree.



What is an index node in linux? What is it used?

In Linux, each file has an I node that stores the owner's identity, permissions, and time information. Note: I node does not save the file name. The file name is saved in a dentry named directory item.
You can use ls-I and stat to add file names to view the I node information of the file,
The Linux kernel often uses the I node information to identify files. The I node number of each file is unique!

What is the structure and function of the index node in the Linux Virtual File System?

Index nodes are an important part of UNIX file systems. Generally, you do not need to consider them, but it is really necessary to know what they are.
An index node is a data structure used to describe files on a disk. it stores most of the important information about the file, including the address of the file data block (the part of the file you are concerned about) on the disk. each index node has its own ID (I-number ). in fact, you do not need to worry about the physical address of the file on the disk or the index number unless you want to find a link to the file. however, you are concerned about the following information, and they are all stored in the index node of the file:
File Ownership: users and groups with files
File Access Mode: whether different users and groups can read, write, or execute files.
File time mark: The last modification time, last access time, and last modification time of the index node.
File Type: whether it is a regular file, a special file, or another type of abstract camouflage file.
When a file system is created for the first time (usually when the disk is initialized for the first time), a number of index nodes are created for each file system. this is the maximum number of files that the file system can accommodate. this number cannot be changed as long as the file system is not reinitialized; otherwise, all data on the file system will be damaged. it is very likely (though rare) that the file system will use up all the index nodes, just as it may have used up storage space-when the file system has many small files, this may happen.
The ls-l command will display the index number of the file in most of the information. The ls-I option command will list almost all the information in the index node.
 

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.