首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >下面的Chmod命令是做什么的?

下面的Chmod命令是做什么的?
EN

Stack Overflow用户
提问于 2012-09-13 00:33:42
回答 2查看 411关注 0票数 0

我在下面的页面上遇到了一个命令。http://alblue.bandlem.com/2011/07/setting-up-google-code-with-git.html

chmod go= .netrc

在chmod man里找不到。

EN

回答 2

Stack Overflow用户

发布于 2012-09-13 00:50:05

来自chmod手册页中的“有效模式示例”:

go=清除group和others的所有模式位。

票数 2
EN

Stack Overflow用户

发布于 2012-09-13 00:38:53

这意味着“绝对设置这些权限”。在本例中,您将清除文件.netrc上的go权限(因为您没有在等号后面命名任何权限)。

如果你做了这样的事情:

chmod go=r .netrc

您将授予readgroupother的权限,但清除go的所有其他权限。

下面是一些示例:

代码语言:javascript
复制
~> 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页面。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12392692

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档