我在下一頁遇到一個命令。 http://alblue.bandlem.com/2011/07/setting-up-google-code-with-git.html下面的Chmod命令是做什麼的?
搭配chmod去=的.netrc
不能在使用chmod人發現它。
我在下一頁遇到一個命令。 http://alblue.bandlem.com/2011/07/setting-up-google-code-with-git.html下面的Chmod命令是做什麼的?
搭配chmod去=的.netrc
不能在使用chmod人發現它。
chmod go= .netrc
無法訪問羣組和其他人以歸檔.netrc
。
chmod go=rx .netrc
給予讀取和執行access`
基本上你可以添加+
,減-
並分配=
一定的訪問級別。
這意味着「完全設置這些權限」。在這種情況下,您將清除文件.netrc
上的g
和o
權限(因爲您沒有在等號後面命名任何權限)。
如果你不喜歡的東西:
CHMOD去= R的.netrc
你會被給予read
權限的group
和other
,但清除所有其他權限g
和o
。
下面是一些例子:
~> pico test.txt <-- Create a file with default permissions
~> ls -l test.txt
-rw-r--r-- 1 mike staff 7 Sep 12 09:39 test.txt
~> chmod go= test.txt <-- Clear the permissions on g and o
~> ls -l test.txt
-rw------- 1 mike staff 7 Sep 12 09:39 test.txt
~> chmod go=r test.txt <-- Set only read on g and o
~> ls -l test.txt
-rw-r--r-- 1 mike staff 7 Sep 12 09:39 test.txt
~> chmod o=rw test.txt <-- Set read and write only on o
~> ls -l test.txt
-rw-r--rw- 1 mike staff 7 Sep 12 09:39 test.txt
更多信息,請參閱下符號模式的man頁面。
從搭配chmod手冊頁「有效模式的例子」:爲組和其他
去=清除所有模式位。
GNU版本中不存在GNU版本的這一部分,但在手冊頁的頂部有一個非常清晰的說明,信息手冊中存在示例_does_。所以,這是一個很好的答案。 – abarnert
如果你使用GNU CHMOD(例如,在Linux上),聯機幫助頁的說明部分中有一個非常清晰和簡潔的描述中使用的符號模式,以及手動的信息具有完全相同的例子你給了。如果您使用的是BSD chmod(例如,在Mac上),則聯機幫助頁中的「有效模式示例」部分與您給出的示例完全相同。 – abarnert