熱搜:win11繞過硬件限制安裝 一鍵重裝Win10系統(tǒng) 最干凈的u盤啟動盤 真正純凈版的win7系統(tǒng)
時間:2014-12-30 15:59:19 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時看資訊 2. 請使用手機瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20141230/33739.html 手機查看 評論 反饋
實例4:使用“=”設(shè)置權(quán)限
命令:
代碼如下:
chmod u=x log2012.log
輸出:
代碼如下:
[root@localhost test]# ls -al log2012.log
-rw-rw-r-- 1 root root 302108 11-13 06:03 log2012.log
[root@localhost test]# chmod u=x log2012.log
。踨oot@localhost test]# ls -al log2012.log
---xrw-r-- 1 root root 302108 11-13 06:03 log2012.log
說明:
撤銷原來所有的權(quán)限,然后使擁有者具有可讀權(quán)限
實例5:對一個目錄及其子目錄所有文件添加權(quán)限
命令:
代碼如下:
chmod -R u+x test4
輸出:
代碼如下:
。踨oot@localhost test]# cd test4
。踨oot@localhost test4]# ls -al
總計 312drwxrwxr-x 2 root root 4096 11-13 05:50 。
drwxr-xr-x 5 root root 4096 11-22 06:58 。。
-rw-r--r-- 1 root root 302108 11-12 22:54 log2012.log
-rw-r--r-- 1 root root 61 11-12 22:54 log2013.log
-rw-r--r-- 1 root root 0 11-12 22:54 log2014.log
[root@localhost test4]# cd 。。
。踨oot@localhost test]# chmod -R u+x test4
。踨oot@localhost test]# cd test4
。踨oot@localhost test4]# ls -al
總計 312drwxrwxr-x 2 root root 4096 11-13 05:50 。
drwxr-xr-x 5 root root 4096 11-22 06:58 。。
-rwxr--r-- 1 root root 302108 11-12 22:54 log2012.log
-rwxr--r-- 1 root root 61 11-12 22:54 log2013.log
-rwxr--r-- 1 root root 0 11-12 22:54 log2014.log
說明:
遞歸地給test4目錄下所有文件和子目錄的屬主分配權(quán)限
其他一些實例:
1)。
命令:
代碼如下:
chmod 751 file
說明:
給file的屬主分配讀、寫、執(zhí)行(7)的權(quán)限,給file的所在組分配讀、執(zhí)行(5)的權(quán)限,給其他用戶分配執(zhí)行(1)的權(quán)限
2)。
命令:
代碼如下:
chmod u=rwx,g=rx,o=x file
說明:
上例的另一種形式
3)。
命令
代碼如下:
chmod =r file
說明:
為所有用戶分配讀權(quán)限
3)。
命令:
代碼如下:
chmod 444 file
說明:
同上例
4)。
命令:
代碼如下:
chmod a-wx,a+r file
說明:
同上例
上面就是系統(tǒng)之家的小編給你帶來的Linux中chomd命令的用法介紹,chomd命令可以同時修改不同用戶的權(quán)限、刪除用戶的權(quán)限等。
發(fā)表評論
共0條
評論就這些咯,讓大家也知道你的獨特見解
立即評論以上留言僅代表用戶個人觀點,不代表系統(tǒng)之家立場