The properties of a Linux file or directory include: the node of the file or directory, the type, the permission mode, the number of links, the user and group of users to which they belong, the time of the last visit or modification, and so on. The details are as follows:
Command:
Ls-lih
Output:
[Root@localhost test]# Ls-lih
Total 316K
2095120 lrwxrwxrwx 1 root 11-22 06:58 linklog.log-> log2012.log
2095112-rw-r--r--1 root root 296K 11-13 06:03 log2012.log
2095110-rw-r--r--1 root 11-13 06:03 log2013.log
2095107-rw-r--r--1 root 0 11-13 06:03 log2014.log
2095117-rw-r--r--1 root 0 11-13 06:06 log2015.log
2095118-rw-r--r--1 root 0 11-16 14:41 log2016.log
2095119-rw-r--r--1 root 0 11-16 14:43 log2017.log
2095113 drwxr-xr-x 6 root 4.0K 10-27 01:58 SCF
2095109 drwxrwxr-x 2 root 4.0K 11-13 06:08 test3
2095131 drwxrwxr-x 2 root 4.0K 11-13 05:50 test4
Description
First column: Inode
Second column: Types of documents and authority;
The third column: The number of hard links;
The fourth column: the owner;
Column Fifth: The group to which it belongs;
Sixth column: size of file or directory;
Columns seventh and eighth: time of last visit or modification;
Nineth column: File name or directory name
We take Log2012.log as an example:
2095112-rw-r--r--1 root root 296K 11-13 06:03 log2012.log
The value of the inode is: 2095112
File type: File type is-, to indicate that this is a normal file; For the type of file, refer to: A daily Linux command: Linux file type and extension
File permissions: File permissions are rw-r--r--, means that the file is the main readable, writable, not executable, the file belongs to the user group is not writable, readable, can not be executed, other users can not write, readable, do not execute;
Number of hard Links: log2012.log This file does not have a hard link, because the value is 1, is his own;
File owner: Which is the file to which users, it is attributed to root, that is, the first root;
File group: That is to say, for this file, it belongs to which user group, where is the root group;
File size: File size is 296k bytes;
Access can be modified: The time here is the last access time, the last access and file was modified or created time, sometimes not consistent;
Of course the attributes of the document are not just those, these are some of our most common attributes.
About Inode:
An inode is an index node that is translated into Chinese. Each storage device or storage device partition (storage device is a hard disk, floppy disk, USB disk, etc.) is formatted as a file system, there should be two parts, part of the Inode, the other part is Block,block is used to store data. The inode is the information that is used to store the data, including the file size, the owner, the attribution user group, the read and write permissions, and so on. The Inode indexes information for each file, so there is a value for the inode. The operating system according to the instruction, can through the Inode value the quickest to find the corresponding file.
A metaphor, such as a book, a storage device or partition is the equivalent of this book, block is equivalent to every page in the book, the Inode is equivalent to this book in front of the directory, a book has a lot of content, if you want to find a part of the content, we can first check the directory, through the directory to find the fastest we want to see the content. Although not very appropriate, but still relatively image.
When we use LS to view a directory or file, if you add the-i parameter, we can see the inode node, such as the example we mentioned earlier:
[Root@localhost test]# Ls-li Log2012.log
2095112-rw-r--r--1 root root 302108 11-13 06:03 log2012.log
The inode value of the log2012.log is 2095112; View the inode of a file or directory through the-i parameter of the LS command.
See a full set of tutorials: http://www.bianceng.cn/OS/Linux/201301/35075.htm