One linux command every day (25): Explanation of linux file attributes

Source: Internet
Author: User
Tags touch command
A linux command (25) every day: linux file attribute details link: A linux command (1) every day: ls command running (2): cd command http://www.2cto.com/ OS /201210/163050.html#every day...
One linux command every day (25): linux file attribute details link: One linux command every day (1): ls command http://www.2cto.com/os/201210/163049.html ; One linux command every day (2): cd command http://www.2cto.com/os/201210/163050.html ; One linux command every day (3): pwd command http://www.2cto.com/os/201210/163462.html ; One linux command every day (4): mkdir command http://www.2cto.com/os/201210/163463.html ; One linux command every day (5): rm command http://www.2cto.com/os/201210/163662.html ; One linux command (6) every day: rmdir command http://www.2cto.com/os/201210/164017.html ; One linux command (7) every day: mv command http://www.2cto.com/os/201210/164247.html ; One linux command every day (8): cp command http://www.2cto.com/os/201210/164254.html ; One linux command every day (9): touch Command http://www.2cto.com/os/201211/165699.html ; One linux command every day (10): cat command http://www.2cto.com/os/201211/165989.html ; One linux command every day (11): nl command http://www.2cto.com/os/201211/165990.html One linux command every day (12): more command http://www.2cto.com/os/201211/165994.html One linux command every day (13): less command http://www.2cto.com/os/201211/165998.html One linux command every day (14): head Command http://www.2cto.com/os/201211/166191.html One linux command every day (15): tail command http://www.2cto.com/os/201211/168702.html One linux command every day (16): which command http://www.2cto.com/os/201211/168890.html A linux command (17) every day: whereis command http://www.2cto.com/os/201211/168893.html One linux command (18) every day: locate command http://www.2cto.com/os/201211/168895.html One linux command every day (19): find command overview http://www.2cto.com/os/201211/168897.html One linux command every day (20): find command exec http://www.2cto.com/os/201211/168901.html One linux command (21) every day: find command xargs http://www.2cto.com/os/201211/168903.html A linux command (22) every day: detailed description of the parameters of the find Command http://www.2cto.com/os/201211/168912.html A linux command (23) every day: Linux directory structure http://www.2cto.com/os/201211/170430.html One linux command every day (24): Linux file type and extension http://www.2cto.com/os/201211/170431.html The attributes of a Linux file or directory mainly include the node, type, permission mode, number of links, user and user group to which the file or directory belongs, recent access or modification time, and so on. The specific situation is as follows: Command: www.2cto.com ls-lih output: [root @ localhost test] # ls-lih total export k2095120 lrwxrwxrwx 1 root 11 11 11-22 linklog. log-> log2012.log2095112-rw-r -- 1 root 296 K 11-13 06:03 log2012.log2095110-rw-r -- 1 root 61 11-13 06:03 log2013.log2095107-rw- r -- 1 root 0 11-13 log2014.log2095117-rw-r -- 1 root 0 11-13 log2015.log2095118-rw-r -- 1 root 0 11-16 log2016.log2095119-rw-r -- 1 root 0 11-16 log2017.log2095113 drwxr-xr-x 6 root 4.0 K 10-27 0scf2095109 drwxrwxr-x 2 root 4.0 K 11-13 test32095131 drwxrwxr-x 2 root 4.0 K 11-13 test4 instructions: column 1: inode column 2: file types and permissions; Column 3: Number of hard links; Column 4: Owner; Column 5: group to which the file belongs; Column 6: file or directory size; Column 7 and Column 8: Last access or modification time; Column 9: file name or directory name we use log2012.log as an example: 2095112-rw-r -- 1 root 296 K 11-13 06:03 l The value of og2012.loginode is: 2095112 file type: the file type is-, indicating that this is a common file. for the file type, refer to: A linux command (24) every day ): file permission for Linux file types and extensions: the file permission is rw-r --, indicating that the file owner is readable, writable, and unexecutable, and the user group to which the file belongs cannot be written or readable, it cannot be executed. other users cannot write, read, or execute the file. hard link count: log2012.log does not have a hard link. because the value is 1, it is the file itself. file owner: that is, the user to which the file belongs. it is root, that is, the first root. file group: that is, the user group to which the file belongs, here is the root user group; file size: the file size is kb; the access time can be modified: the time here is the last access time, the last time the access and file were modified or created is sometimes not the same; of course, the attributes of the document not only include these, these are some of our most common attributes. Inode: inode is an index node. After the partition of each storage device or storage device (the storage device is a hard disk, floppy disk, or USB flash disk) is formatted as a file system, there should be two parts, one part is inode, another part is Block, which is used to store data. Inode is used to store the data, including the file size, owner, owner user group, and read/write permissions. Inode indexes information for each file, so there is an inode value. Based on commands, the operating system can find the corresponding files with the fastest inode value. To make a metaphor, for example, a book, a storage device or partition is equivalent to this book. Block is equivalent to every page in the book, and inode is equivalent to the directory before this book. a book has a lot of content, if you want to find a part of the content, you can first check the directory to find the content we want to see as quickly as possible. Although not appropriate, it is still a relatively good image. When we use ls to view a directory or file, if we add the-I parameter, we can see the inode node. for example: [root @ localhost test] # ls-li log2012.log 2095112-rw-r -- 1 root 302108 11-13 03 log2012.loglog2012. the inode value of log is 2095112. to view inode of a file or directory, use the-I parameter of the ls command.
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.