Ls
Linux "ls-l" File list permissions detailed
1. The results of the execution using the LS-L command are as follows (/var/log):
Drwxr-x---2Root ADM4096 -- ,- - One:Genevaapache2 drwxr-xr-x2Root root4096 -- ,- - the: +AppArmor drwxr-xr-x2Root root4096 -- ,- - the: -Apt-rw-r-----1Syslog ADM16802 -- ,- - -: -Auth.log-rw-r--r--1Root root642 -- ,- - One:GenevaBoot.log drwxr-xr-x2Root root4096 -- ,- . -: theConsolekit drwxr-xr-x2Root root4096 -- ,- - the: -Cups-rw-r-----1Syslog ADM10824 -- ,- - One: ,Daemon.log drwxr-xr-x2Root root4096 -- ,- - the: $dbconfig-Common-rw-r-----1Syslog ADM21582 -- ,- - One:GenevaDebug DRWXR-xr-x2Root root4096 -- ,- - the: $dist-Upgrade-rw-r--r--1Root ADM59891 -- ,- - One:GenevaDmesg
The display results are broadly divided into seven columns (partial):
Take the first record as an example
First column: "Drwxr-x---" the type and file permissions of a file The second column: "2" is a pure number, indicating the number of file links (an empty directory of the field is 2, indicating that the directory has two subdirectories , because each directory has a subdirectory that points to itself "." and a subdirectory that points to its parent directory "..." The third column: "Root" means the owner of the file fourth column: "ADM" is represented as the group Fifth column of the file: "4096", expressed as the file length (size) Sixth column: " from-£ º"," indicates the last update (modified) time of the file seventh column: " Apache2 "indicates the name of the file
See:
2. File type and file permissions, which is the first column of the list: (Take the first record as an example)
"Drwxr-x---" meaning: There are two parts, part of the first column is "D", the file type (directory or folder), the other part is "rwxr-x---" means the file permissions, the permissions are divided into three paragraphs: that is, "rwx", "r-x" and "---" respectively, the text The permissions of the owner of the file, the rights of the group to which it belongs, and other user permissions on the file.
(1) file types, broadly divided into the following categories:
d: Catalogue - : File L: Link s:socket p:named pipe b:block device C : Character device
(2) file permissions:
4 represents W 2 represents 1 represents -: Meaning "No permissions" is represented by the number 0 x (large X): meaning that only the destination file is executable to some users or the target file is a directory when the x attribute is appended.
S: A file in which the owner or group ID of a process is placed at the time of execution of the file. The user ID bit of the "u+s" setting file , "G+s" sets the group ID bit.
See the following list for the meanings of numbers:
Owner |
Group |
Other |
Number of three-bit delegate permissions |
R W X |
Rwx |
Rwx |
Actual results |
4 2 1 |
421 |
421 |
777 |
4 2 1 |
4 0 1 |
4 0 1 |
705 |
Transfer from http://blog.csdn.net/jenminzhang/article/details/9816853
Linux "ls-l" File list permissions detailed