我正在尝试为名为 Sales 的文件夹设置文件权限。我正在做一个学校项目,我想提供有关文件权限的教程。
我正在使用 vmware 工作站,当我继续销售权限并尝试设置文件权限时,它将返回到-
.
另外,我无法勾选将文件作为程序执行:S ...
当我尝试这样做时,勾号也会自动消失。
这很奇怪,但不知道发生了什么。
打开终端,并给出执行标志,执行以下操作:
chmod +x a.sh
Run Code Online (Sandbox Code Playgroud)
a.sh
您想要执行的文件在哪里。
要更改读取或写入权限,请执行以下操作:
chmod -r a.sh # make it non-readable
chmod +r a.sh # make it readable
chmod -w a.sh # make it non-writeable
chmod +w a.sh # make it writeable
Run Code Online (Sandbox Code Playgroud)
由于每个文件都属于一个用户并属于一个组,因此您可以特定于用户、组或每个人,分别在权限选项前加上字母 u、g 和 o。所以你可以:
chmod g+w a.sh # make it writeable by the group a.sh belongs
chmod o-w a.sh # make it non-writeable by others than the user and the group a.sh belongs
chmod g+w,o-w a.sh # The same as the two lines before, but in one line
Run Code Online (Sandbox Code Playgroud)
有关更多选项,请检查man chmod
归档时间: |
|
查看次数: |
2677 次 |
最近记录: |