Article Title: Linux file attributes. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux Files. files starting with ls are regarded as hidden files and cannot be seen only by using ls commands. In addition to displaying common file names, ls-a can also display hidden files.
Ls-l (this parameter is the lowercase letter of L, not the number 1)
This command can display the file content in a long format. If you need to view more detailed file information, you need to use the ls-l command. For example, if I Type ls-l in a directory, the following information may be displayed (a total of 7 columns ):
Location ??? 1 ??????? 2 ????????? 3 ?????????? 4 ??? ??? ??? 5 ??? ??? ??? 6 ??? ??? ??? ??? 7
File Attribute file number the group file size to which the owner belongs file name creation date
Drwx ------ 2 Guest users 1024 Nov 21 Mail
-Rwx -- x 1 root 89080 Nov 7 tar *
-Rwxr-xr-x 1 root bin 5013 Aug 15 9:32 uname *
Lrwxrwxrwx 1 root 4 Nov 24 :30 zcat-> gzip
-Rwxr-xr-x 1 root bin 308364 Nov 29 7:43 zsh *
-Rwsr-x --- 1 root bin 9853 Aug 15 su *
The first column indicates the attributes of the file. Linux Files are basically divided into three attributes: readable (r), writable (w), and executable (x ). However, there are ten grids that can be added here (10 bits are actually implemented in a specific program ). The first cell is a special cell, indicating a directory or a link file, etc. d indicates a directory, for example, drwx ------; l indicates a link file, for example, lrwxrwxrwx; if it is a horizontal, indicates that this is a file. The remaining grids are in the unit of 3. Because Linux is a multi-user multi-task system, a file may be used by many people at the same time, so we must set the permissions for each file, the permission positions of the files are arranged in the following order (-rwxr-xr-x is used as an example ):
Rwx (Owner) r-x (Group) r-x (Other)
In this example, the permissions are as follows: users are readable, writable, and executable; users in the same group are readable, writable, and executable; other users are readable, writable, and executable. In addition, the execution of some program properties is not x, but s, which indicates that the user who executes the program can temporarily execute the program with the same power as the owner. Generally, commands or programs such as System Management enable the user to have the root identity during execution.
The second column indicates the number of files. If it is a file, the number is naturally 1. If it is a directory, the number is the number of files in the directory.
The third field indicates the owner of the file or directory. If the user is currently in his/her home, this column is probably the name of his/her account.
The fourth column, indicating the group to which it belongs ). Each user can have more than one group, but most users should belong to only one group. Only when the system administrator wants to grant special permissions to a user, to another group.
The fifth column indicates the file size. The file size is represented by byte, while the empty directory is usually 1024 bytes. Of course, you can use other parameters to make the file display unit different, for example, if ls-k is used, the size unit of a file is displayed in kb. However, we generally use byte as the main unit.
The sixth column indicates the creation date. In the format of "month, day, and time", for example, Aug 15 indicates on January 1, August 15.
The seventh column indicates the file name. We can use ls-a to display hidden file names.