Modify file permission records in Linux

Source: Internet
Author: User

Modify file permission records in Linux

1. There are three types of files,

Use ls-l to query. Files starting with "1", directories starting with "d" (commonly known as folders), and connections starting with the letter "l.

2. The remaining nine are three in one group, each of which has four types of symbols: "r", "w", "x", and "-".

R (read): indicates the read permission.

W (write): indicates the write permission.

X (execuite): indicates the execution permission.

-: Indicates that you do not have this permission.

3. The first group indicates the permissions of the owner of the file.

The second group represents the permissions assigned to the file by the owner of the file in the same group.

The third group indicates the permissions that other people except the group have on the file.

4. Modify permissions

You can use the command chmod to grant permissions to files.

Normal correction:

Chmod + x "file name": grant permissions to all users (that is, the owner, the same group member, and persons outside the group ).

Chmod u + x "file name": grant permissions to yourself. u indicates that the user is the user.

Chmod g + x "file name": grant permissions to yourself. g: indicates that grup is the same group of people.

Chmod o + x "file name": grant permissions to yourself. o: indicates that other is another person.

Professional Reform

Chome 755 file name

Reason: the permission to be modified is represented by three octal rules.

For example, the format-rwx r-x --- can be expressed as 0 or 1. If-is displayed above, it is expressed as 0, if it is 1, it indicates that you have the corresponding read/write permission.

Binary Octal
111 (rwx) 7
110 (rw -) 6
101 (r-x) 5
100 (r --) 4
011 (-wx) 3
010 (-w -) 2
001 (-- x)
1
000 (----) 0

Welcome to my personal website

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.