Article Title: Modification of file access permissions in Unix operating systems. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In a Unix operating system, you can use the chmod command to modify the file access permission. The format of the chmod command is as follows:
Format 1: chmod symbolic_mode file...
Format 2: chmod absolute_mode file...
Format 1: symbolic_mode. The command format of the symbolic mode is as follows:
Chmod [who] op permision file...
The who item indicates the user type, and its content is one or more of the following:
U file owner)
G User group)
O others (other)
A all)
Op indicates action:
+ Indicates adding the permission specified by permission.
-Cancels the permission specified by permission.
A permission item is an access permission with one or more of the following content:
R indicates readable
W indicates writable
X indicates executable
Example:
The chmod u + w test report owner is "writable" to the test and report files"
The chmod u-x abc. c owner cannot execute the abc. c file.
Chmod u + rwx myfile1 owner for myfile1 "readable, writable, and executable"
Chmod ugo + rwx myfile2 anyone on myfile1 "readable, writable, and executable"
Format 2: absolute mode (absolute_mode). The command format of symbolic mode is as follows:
Chmod xyz file...
X, y, and z are numbers 0-7 respectively, indicating the access permissions of the owner, user group, and others to the file. The values of x, y, and z are:
A * 4 + B * 2 + c
Where,
A = 1 indicates readable, and a = 0 indicates unreadable;
B = 1 indicates writable, and B = 0 indicates non-writable;
C = 1 indicates executable, and c = 0 indicates not executable;
Example:
Chmod 751 ncp owners have all the rights to "read, write, and execute" to ncp; members in the group have only the "readable and executable" rights to ncp; other users have only "executable" rights to ncp.