Linux document permission management

Source: Internet
Author: User
1. Linux document permission management

  The first column indicates the document type and permissions.

[-] [Rwx] [rwx] [RW-] indicates the permission and type of this document. The first character indicates that this document is a directory, file, or link file.
  • If it is [d], it is a directory.
  • If it is [-], it is a document
  • If it is [L], it is a link file)
  • If [B] is used, it is the interface device for storage of Device Files (random access device)
  • If it is [c], it is the serial port device in the device file. For example, the mouse (one-time reading device)
The next three parameters are a combination of the three parameters of [rwx]. r indicates readable, W indicates writable, and X indicates executable execute, the three new locations remain unchanged. If you do not have the permission, the minus sign [-] will appear.
  • The first group is the document owner's permissions.
  • Permissions of the second group in the same group
  • Other permissions of the third group that are not in this group
The second column indicates how many document names are linked to this node.
Each document records its permissions and attributes to the I-node of the file system. However, the directory tree we use is recorded by file name, therefore, each document name is linked to an I-node. This property records how many different document names are linked to the same I-node number.
The third column indicates the owner account of this document or directory. Column 4 indicates the group to which this document belongs. The fifth column shows the capacity of this document. Column 6 shows the latest modification date of this document. Command for modifying file attributes and permissions
  • Chgrp: Change the group to which the document belongs: chgrp [-R] group name document name (r indicates that the entire directory is changed to the corresponding group)
Change the group named test.txt to test, for example, chgrp test test.txt.
  • Chown: Change the document owner: chown [-R] account name document or directory [chown [-R] Account name: group name document or directory]
Modify the user permission of the test file directory to test01 and the group to gtestchown-r test01: gtest test.
  • Chmod: Change the document permission: chmod [-R] Permission value document or directory [permission value: r = 4, W = 2, x = 1, the three permissions (R/W/X) of each identity (owner/group/others) must be accumulated]
For example, rwx---owner = rwx = 4 + 2 + 1 = 7 Group = rwx = 4 + 2 + 1 = 7 others =--= 0 + 0 + 0 = 0. For example, the user of the test document has his or her own permissions, in the same group, other groups can be modified to read and write, and chmod-r 777 test can be executed.

[Insert]

Related Article

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.