The chmod (change mode) function of a linux Command every day is to change the file or directory permissions. Chmod -- help can be used to view specific parameters. Www.2cto.com 1. Permission 1. linux has general and special permissions. General permissions: r -- read, w -- write, and x -- execute. Special permissions: setuid-grant normal users the permissions that can be executed by the root user. setgid-similar to setuid, indicates the group, stick bit-the pasting position can be deleted only by the owner and root users. 2. r w x, which forms a three-digit binary number. If you have the permission, it is 1. If not, it is 0. So 0 is none, 1 is only x, 2 is only w, 3 is w and x, and so on. Setuid setgid stickbit is similar. -For users without permissions: u: user file or directory owner g: group file or directory owner o: other except for other users: all users www.2cto.com 3. permission settings: +: Add permission-: Remove permission =: Set the permission chmod u + rw test.txt to give the owner the permission to read and write test.txt. Chmod 644 test.txt sets the read and write permissions for the owner of test.txt, the group and other users. Chmod 1777 the first temp 1 is stick bit, which grants rwxrwxrwt permission to the temp file.
Author: CrazyNemo