View and modify file permissions under Linux

Source: Internet
Author: User

View Permissions

[Ruby]View PlainCopy 
    1. In Terminal input:
    2. Ls-l xxx.xxx (xxx.xxx is the file name)
    3. Then there will be similar messages, mostly these:
    4. -rw-rw-r--

[Ruby]View PlainCopy 
    1. Which: the front one-represents the type
    2. The middle three rw-represents the owner (user)
    3. Then those three rw-represent groups (group)
    4. The last three r--represent others (other).
    5. And then I'll explain the 9 digits in the back:
    6. R indicates that a file can be read (read)
    7. W indicates that the file can be written (write)
    8. x indicates that the file can be executed (if it is a program)
    9. -Indicates that the appropriate permission has not been granted



Modify Permissions

[Ruby]View PlainCopy 
    1. In Terminal input:
    2. chmod o+w xxx.xxx
    3. Give other people permission to write xxx.xxx this file
    4. chmod GO-RW xxx.xxx
    5. Represents the deletion of read and write permissions for groups and others in xxx.xxx

[Ruby]View PlainCopy  
    1. U on behalf of owner (user)
    2. G represents the group where the owner resides
    3. O stands for others, but not u and g (other).
    4. A represents all people, including U,g and O.
    5. R indicates that a file can be read (read)
    6. W indicates that the file can be written (write)
    7. x indicates that the file can be executed (if it is a program)


Numbers instead

[Ruby]View PlainCopy  
    1. Where: Rwx can also be replaced by numbers
    2. R------------4
    3. W-----------2
    4. X------------1
    5. -------------0
    6. Let's go:
    7. + means add permission
    8. -Indicates delete permission
    9. = indicates a permission to make it unique



[Ruby]View PlainCopy  
    1. -RW-------(600) Only the owner has read and write permissions
    2. -rw-r--r--(644) Only the owner has read and write permissions, and the group and other people only have Read permissions
    3. -RWX------(700) Only the owner has read, write, execute permissions
    4. -rwxr-xr-x (755) Only the owner has read, write, execute permissions, groups and other people only read and Execute permissions
    5. -rwx--x--x (711) Only the owner has read, write, execute permissions, groups and other people only execute the permissions
    6. -rw-rw-rw-(666) Everyone has access to read and write
    7. -RWXRWXRWX (777) Everyone has access to read and write and execute

[HTML]View PlainCopy 
      1. When executing Mkdir/nfs in the script, I found that I had already created the/nfs directory, so I got an error, and then I stuck there and asked for a solution:
      2. Mkdir-p/nfs
      3. That is, by adding the-p parameter, you only know that the directory was created recursively

View and modify file permissions under Linux

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.