Follow the bird Brother learn Linux Summary file permissions

Source: Internet
Author: User

Linux is a file, bird brother called the archives. Since it's a file, the file has the following features.
1. User of the file
2. Permissions of the file
3. Types of Archives

1. User of the file
Files can be managed, modified, and queried by people of different roles. Roles are divided into the following three types
1. Owner of the file: User
2. Group: Group
3. Other: Others
Root user has the overriding privileges

2. Permissions of the file
Files can be divided into readable (read), writable (write), executable x (execute) three operation permissions. Files can be assigned different permissions according to different users, such as the user can have a file of R, W, x permissions, and others can only have the R permission of the file.

3. Types of Archives
Files by type can be divided into,-file, D directory, L link file, b storage interface device, C serial Interface device (mouse, keyboard)

Use the LL command to view the details of an answer in the current directory

    • rw-rw-r--1 Zhangsenhan Zhangsenhan 8 Mar 21:55 my_file contains the following content
      The first group-the type of the representative file-the file
      The second set of rw-represents the user's right to have the file, that is, R readable, W writable, because My_file is a text file, there is no executable operation, only the binary file has the X executable permission.
      The third group of rw-represents the group's rights to the file, and users within the group inherit the group's permissions
      Group Fourth r--represents others's right to have the file, which is read-only
      Group Fifth 1 represents the number of linked files
      Group Sixth Zhangsenhan represents the owner of the file
      Group Seventh Zhangsenhan represented as the group belonging to the archive
      Group Eighth 8 represents the size of the file by default to byte
      Date of establishment or modification of the representative file of group Nineth
      Name of the tenth group of files

      Change file properties and permissions
      CHGRP: Change the group to which the profile belongs
      Chown: Change the file owner
      chmod: Change permissions for a file

      Change the file group to root

      Change the file owner to root

      Change Permissions chmod has 2 settings, digital settings and character settings
      Digital setting
      R for the digital 4,w represents the number 2,x represents the number 1 rwx can be represented as three numbers added 7
      For example, set the user permission to 7 group permission set to 7 others permission set to 0

      Character setting
      Set the user permission to Rw-group permission to r-x others permission is set to rw-

      Add or remove permission values

Follow the bird Brother learn Linux Summary file permissions

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.