One Linux command per day: A detailed description of Linux file attributes

Source: Internet
Author: User
Tags readable

Http://www.cnblogs.com/peida/archive/2012/11/23/2783762.html

The properties of a Linux file or directory include: The file or directory's node, kind, permission mode, number of links, the user and user group to which it belongs, the time recently accessed or modified, and so on . The details are as follows:

Command:

Ls-lih

Output:

[[email protected] test] # Ls-lih

Total 316K

2095120 lrwxrwxrwx 1 root root one 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 root 11-13 06:03 log2013.log

2095107-rw-r--r--1 root root 0 11-13 06:03 log2014.log

2095117-rw-r--r--1 root root 0 11-13 06:06 log2015.log

2095118-rw-r--r--1 root root 0 11-16 14:41 log2016.log

2095119-rw-r--r--1 root root 0 11-16 14:43 log2017.log

2095113 drwxr-xr-x 6 root root 4.0K 10-27 01:58 scf

2095109 drwxrwxr-x 2 root root 4.0K 11-13 06:08 test3

2095131 drwxrwxr-x 2 root root 4.0K 11-13 05:50 test4

Description

First column: Inode

Second column: File types and permissions;

The third column: The number of hard links;

Column Fourth: Owner;

Column Fifth: The group to which it belongs;

Sixth column: The size of the file or directory;

Columns seventh and eighth: last access or modification time;

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 Inode value is:2095112

File type: File type Yes-, indicates that this is an ordinary file; For the type of file, refer to: one Linux command per day: Linux file type and extension

File permissions: File permissions are rw-r--r-- , indicating that the file belongs to the main readable, writable, non-executable, the user group belonging to the file is not writable, readable, non-executable, other users are not writable, readable, not enforceable;

Number of hard links: log2012.log This file does not have a hard link, because the value is 1, which is himself;

File owner: That is the file belongs to which user, it is attributed to root, that is, the first root;

File group: That is, for this file, it belongs to which user group, here is the root user group;

File size: File size is 296k bytes;

Access modifiable time: The time here is the last access time, the last access and the time the file was modified or created, sometimes not consistent;

Of course, the properties of the document not only include these, but these are some of the most commonly used properties.

About Inode:

The inode is translated into Chinese as an index node. Each storage device or storage device partition (storage device is hard disk, floppy disk, USB stick, etc.) after being formatted as a file system, there should be two parts, one part is Inode, the other part is Block,block is used for storing data. The inode is the information that is used to store this data, including file size, owner, attribution user group, read-write permission, and so on. The Inode indexes the information for each file, so there is a value for the inode. According to the instructions, the operating system can find the corresponding file by the Inode value.

To make a metaphor, such as a book, a storage device or partition equivalent to this book, block equivalent to each page of the book, the Inode is equivalent to the 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 look at the directory, through the directory can find the fastest we want to see Although not very appropriate, but still a comparative image.

When we use LS to view a directory or a file, if you add the-i parameter, you can see the Inode node, such as the example we said earlier:

[[email protected] 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 to pass the-i parameter of the LS command.

One Linux command per day: A detailed description of Linux file attributes

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.