Linux Command-based chmod usage and linuxchmod usage
Chmod: Change permissions
Method 1:Use a number to change the permissions of a file or path
The permission score is as follows:
R: 4
W: 2
X: 1
Identity includes:
User: u, group: g, other: o
For example,-rwxrwx --- indicates that the file permissions are:
User: 4 + 2 + 1 = 7
Group: 4 + 2 + 1 = 7
Other: 0 + 0 + 0 = 0
Note: In this case, drwxrwx ---, the first letter is d, indicating a path, with the same permissions as above
Change the File Permission to-rwxr-xr-x.
Chmod 755 file
NOTE: If it is a directory, the code is: chmod 755 dir; if all the contents are 755, then: chmod 755-R dir
Method 2:Use the symbol type to change File Permissions
User: u + (ADD) r
Group: g-(remove) w files or directories
Other: o = (SET) x
All:
Chmod a + x file adds execution permissions to u, g, and o
Chmod u-w file removes write permission from u
You can also use this method: chmod u = rwx, go = rx file is equivalent to chmod 755 file