Chomd for Linux and chomd for Linux

Source: Internet
Author: User

Chomd for Linux and chomd for Linux
Chmod [options] mode files
Only file owners or privileged users can use this function to change the file access mode. Mode can be in the digital format or in the who opcode permission format. Which is optional. The default value is a (all users ). Only one opcode can be selected ). You can specify multiple modes separated by commas.
Options:
-C, -- changesOnly output the information of the changed File
-F, -- silent, -- quietWhen the chmod mode cannot be changed, the file user is not notified.
-- HelpOutput help information.
-R, -- recursiveRecursively traverse sub-directories and apply modifications to all files and sub-directories in the directory
-- Reference = filenameSet the permission by referring to the filename permission.
-V, -- verboseWhether the modification is successful or not, the information of each file is output.
-- VersionOutput version information.
Who
UUser
GGroup
OOthers
AAll users (default)
Opcode
+Add Permissions
-Delete permission
=Reassign Permissions
Permission
RRead
WWrite
XRun
SSet the ID of a user (or group)
TSets sticky bit to prevent files or directories from being deleted by non-owners.
UCurrent User Permissions
GCurrent permissions of the Group
OCurrent permissions of other users

For selection, we usually use three Octal numbers to indicate permissions. The first one is the owner permission, the second is the group permission, and the third is the permission of other users, each permission is determined by the sum of four (read), two (write), and one (execution) values. For example, 6 (4 + 2) indicates that you have the read and write permissions, and 7 (4 + 2 + 1) indicates that you have the read, write, and execution permissions.
You can also set the fourth digit, which is located before the three-digit permission sequence. The fourth digit is 4, 2, and 1, which means the following:
4. Set the user ID during execution to authorize the process based on the file owner, instead of the user who creates the process.
2. Set the user group ID during execution to authorize the process based on the file group, instead of the user who creates the process.
1. Set the adhesion position.
Instance:
$ Chmod u + x file: add the execution permission to the file owner.$ Chmod 751 the file owner is assigned the read, write, and execute permissions (7) to the file owner, and the read and execute permissions (5) to the file group, assign execution (1) permissions to other users$ Chmod u = rwx, g = rx, o = x file$ Chmod = r file: Assign read permissions to all users$ Chmod 444 file: Same as above$ Chmod a-wx, a + r file is the same as above.$ Chmod-R u + r directory recursively assign read permissions to the owner of all files and subdirectories in the directory$ Chmod 4755 sets the ID to assign read, write, and execute permissions to the owner, and assign read and execute permissions to the group and other users.

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.