In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about what the file attributes are in linux. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Linux file or directory attributes mainly include: file or directory node, type, permission mode, number of links, belonging users and user groups, the last access or modification time and so on. Details are as follows:
Command: ls -lih
Output:
The code is as follows:
[root@localhost test]# ls -lih
Total 316K
2095120 lrwxrwxrwx 1 root root 11 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 61 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
Column 2: file type and permissions;
Column 3: Number of hard links;
Fourth column: Belonging to the Lord;
Column 5: Group to which it belongs;
Column 6: Size of file or directory;
Columns 7 and 8: time of last access or modification;
Column 9: File name or directory name
Let's take log2012.log as an example:
The code is as follows:
2095112 -rw-r--r-- 1 root root 296K 11-13 06:03 log2012.log
The value of inode is 2095112.
File type: file type is-, indicating that this is a normal file; for file types, please refer to: a linux command per day (24): Linux file types and extensions
File permission: file permission is rw-r--r--, indicating that the file belongs to the owner readable, writable, and unexecutable, the user group to which the file belongs cannot write, readable, and unexecutable, and other users cannot write, readable, and unexecutable;
Number of hard links: log2012.log This file has no hard links; because the value is 1, it is itself;
File owner: that is, which user this file belongs to, it belongs to root, that is, the first root;
File belongs to group: that is, for this file, which user group it belongs to, here root user group;
File size: file size is 296k bytes;
Access modifiable time: here the time is the last access time, the last access and the file was modified or created time, sometimes not consistent;
Of course, the attributes of the document do not only include these, these are some of the attributes we use most often.
About inode:
Inode translated into Chinese is index node. Each storage device or partition of a storage device (storage device is a hard disk, floppy disk, USB flash drive, etc.) is formatted as a file system and should have two parts, one part is an inode and the other part is a Block. The inode is the information used to store these data, including file size, ownership, user group, read and write permissions, etc. The inode indexes information for each file, so there is a value for the inode. According to the instructions, the operating system can find the corresponding file most quickly through the inode value.
For example, a book, storage device or partition is equivalent to the book, Block is equivalent to each page in the book, inode is equivalent to the directory in front of the book, a book has a lot of content, if you want to find a part of the content, we can first look up the directory, through the directory can find the content we want to see the fastest. Although it was inappropriate, it was still more vivid.
When we use ls to view a directory or file, if we add the-i parameter, we can see the inode node; for example, we mentioned the example above:
The code is as follows:
[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 log2012.log is 2095112 ; to view the inode of a file or directory, use the-i argument of the ls command.
Thank you for reading! About "what are the file attributes in linux system" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.