1 Modify Permissions
command: chmod (change mode)
function: Change the file read and write and execute permissions. Signed method and octal number method.
option: (1) Symbol method:
command format: chmod {u|g|o|a}{+|-|=}{r|w|x} filename
u (user) indicates the users themselves.
g (group) represents the same group of users.
O (oher) represents another user.
A (All) represents all users.
+ used to give permission to the specified user.
-Used to cancel the permissions of the specified user.
= Assign the permission to the file.
R (Read) Read permission, which means that the contents of the file or directory can be copied.
W (write) writes a permission that indicates that the contents of the file or directory can be modified.
x (execute) Executes the license, indicating that the file can be executed or entered into the directory.
(2) Octal number method:
command format: chmod ABC file
Each of the a,b,c is an octal number, which represents the permissions of user, Group, and other respectively.
4 (100) indicates readable.
2 (010) indicates writable.
1 (001) indicates executable.
to rwx the attribute then 4+2+1=7;
to rw-the attribute then 4+2=6;
to r-x the property, 4+1=5.
Example: # chmod a+rx filename
allows all users to read and execute file filename.
# chmod GO-RX filename
cancels the permissions of the same group and other users to read and execute file filename.
# chmod 741 filename
allow me to read and write execution, the same group of user-readable, other user executable file filename.
# chmod-r 755/home/oracle
recursive change of directory permissions, I can read and write execution, the same group of user-readable executable, other user-readable executable
Linux File Permissions Assignment