1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| chmod [选项] 权限 文件名
[root@localhost ~]# chmod 777 test1.txt [root@localhost ~]# ll test1.txt -rwxrwxrwx. 1 root root 0 Apr 12 17:01 test1.txt [root@localhost ~]# chmod 700 test1.txt [root@localhost ~]# ll test1.txt -rwx------. 1 root root 0 Apr 12 17:01 test1.txt
[root@localhost ~]# chmod g+xw test1.txt [root@localhost ~]# chmod +x test1.txt
[root@localhost ~]# chmod u=rwx,g=w,o=x test1.txt 不如直接修改数字方式 [root@localhost ~]# chmod 721 test1.txt
[root@localhost ~]# chmod -R 222 zls121 [root@localhost ~]# ll -d zls121/ d-w--w--w-. 3 zls121 zls121 139 Apr 12 18:31 zls121/ [root@localhost ~]# ll zls121/ total 0 --w--w--w-. 1 root root 0 Apr 12 18:30 1.txt --w--w--w-. 1 root root 0 Apr 12 18:30 2.txt --w--w--w-. 1 root root 0 Apr 12 18:30 3.txt --w--w--w-. 1 root root 0 Apr 12 18:30 4.txt [root@localhost ~]# ll zls121/zls1/ total 0 --w--w--w-. 1 root root 0 Apr 12 18:31 1.txt
|