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/