Linux Command: chmod

Source: Internet
Author: User

Chmod: Change File Permissions

Symbol mode:

The general format of the CHMOD command is:
Chmod [who] OPERATOR [permission] filename

Who indicates:
U file owner permission
G. permissions of users in the same group
O other User Permissions
A All users (file owner, users in the same group and other users)

Operator meaning:
+ Add permissions
-Cancel permission
= Set permissions

Permission:
R read permission
W write permission
X execution permission
S file owner and Level Set-ID
T viscosity position *
L lock files so that other users cannot access them

Eg:
Chmod A-x file.txt revokes all user execution Permissions
Chmod og-W file.txt revokes write permissions of the same group and other users
Chmod g + W file.txt grant write permission to users in the same group
Chmod U + x file.txt grant the file owner the execution permission
Chmod go + x file.txt grant the same group of users and other users the execution permission

Absolute Mode
The absolute mode of the CHMOD command is generally in the form
Chmod [mode] File
The mode is an octal number.

Eg:
Chmod 666 grants read and write permissions to all users
Chmod 644 grants primary read and write permissions to all files and all other users
Chmod 700 grants the file Master read, write, and execution permissions. Other users do not have any permissions.

The-R parameter can recursively Set permissions for all files, including directories.
Eg:
Chmod-r 744/usr/local/home/

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.