Linux "ls-l" File list permissions detailed

Source: Internet
Author: User
Tags parent directory syslog

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

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.