Chmod Usage
// The first three letters represent the owner. The middle three letters represent the owner. // The last three letters represent the owner group Re-r-xr-x =655 chmod [root@yang-1 ~]# chmod 700 2. TXT // Modify owner has all permissions [root@yang-1 ~]# ls -l total usage 24-rwx ------. 1 root root 846 9月 27 20:46 2.txt // the front group with letters RWX indicates the owner user readable, writable, -rw-------. 1 root root 19184 9月 27 21:37 anaconda-ks.cfg.1 [root@yang-1 ~]#Copy the code
Chmod -r: allows you to modify files in batches for directories or subdirectories under directories
[root@yang-1 ~]# imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp/sci-imp Drwxr-xr-x. 2 root root 6 9月 28 20:40 yang2 [root@yang-1 ~]# ls -l/TMP/Yang [root@yang-1 ~]# chmod -r 777 / TMP/Yang [root@yang-1 ~]# ls -l/TMP/Yang / / / check the permissions total dosage of 0 DRWXRWXRWX. 3 root root 19 September 28 choicest yang1 / / permission to the modified/root @ Yang - 1 ~ # ls - l/TMP/Yang/yang1 / / / to check the permissions total dosage of 0 Drwxrwxrwx. 2 root root 6 9月 28 20:40 yang2 // Permissions have been modified [root@yang-1 ~]#Copy the code
Method of use
[root@yang-1 TMP]# chmod u= RWX,g=r,o=r Yang //u indicates owner,g indicates group, 0 indicates others [root@yang-1 TMP]# chmod a+x Yang // /a indicates all, [root@yang-1 TMP]# ls -ld Yang drwxr-xr-x. 3 root root 19 9月 28 20:40 Yang // all have execute permission [root@yang-1 // / TMP]# chmod a-x Yang [root@yang-1 TMP]# ls -ld Yang // view permission DRW -r--r--. 3 root root 19 9月 28 20:40 Yang // Do not have execute permissionCopy the code