Chmod permission change command

Source: Internet
Author: User
Chmod command for permission change-general Linux technology-Linux technology and application information. The following is a detailed description. After having been in touch with linux for so long, I only know that chmod is used to change permissions. The most commonly used is chmod + x file, or chmod 777 file. Now let's take a look at the essence.

In general, three users can operate the file:

U file owner
G same group users
O other users
A All users (file owner, users in the same group, and other users)

Operations that can be performed include '+' (adding permissions), '-' (canceling permissions), and '=' (setting permissions ).

Permission refers to the r read permission, w write permission, and x execution permission. In absolute mode, each permission bit is represented by an octal number. For example, 0400 indicates that the file owner is readable, 0200 indicates that the file owner is writable, and 0100 indicates that the file owner is executable.

In addition, 0040 indicates that users in the same group are readable, 0020 indicates that users in the same group are writable, and 0010 indicates that users in the same group are executable.

0004 indicates that other users are readable, 0002 indicates that other users are writable, and 0001 indicates that other users are executable.

Now, you can easily understand the read, write, and execute permissions as follows: 4, 2, and 1, for example, chmod 755 file.

7 = 4 + 2 + 1 indicates that the file owner has the read, write, and execute permissions.

5 = 4 + 1 means that users in the same group and other users have read and execute permissions.

Then you can use the chmod command flexibly based on the specific problem.

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.