How Linux modifies permissions for a file or directory (chmod)

Source: Internet
Author: User
The chmod command is a command used on Linux to change permissions, and-R is a recursive traversal of subdirectories, because the file you are manipulating uses the * wildcard character. 777, the first 7 represents the permissions of the owner of the file, the second 7 represents the permissions of the group to which the file belongs, the third 7 represents the permissions of the other user, 7=4+2+1, and the permissions in Linux can be described by numbers. The following are the specific expressions:

4, the user ID is set at execution time, and is used to authorize the file owner-based process instead of the user who created the process.
2, when executed, sets the user group ID, which is used to authorize the process based on the group of files, rather than on the user who created the process.
1, set the sticky bit.

Second, the detailed use of the chmod command is as follows, there is no understanding can be viewed slowly.
chmod----Changing the access mode of one or more files (mode)

chmod [options] mode files

This feature can only be used by a file owner or a privileged user to change the file access mode. Mode can be expressed in digital form or in the form of who opcode permission. Who is optional and the default is a (all users). Only one opcode (opcode) can be selected. Multiple mode can be specified, separated by commas.


Grant a file to anyone full rights: Chmod-r 777 filename

How Linux modifies permissions for a file or directory (chmod)

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.