【发布时间】:2020-01-29 08:16:03
【问题描述】:
如果是两个命令,则授予所有者读写权限并从组中删除执行权限,
chmod u +rw Test
chmod g -x Test
或者可以在一个命令中完成吗?
【问题讨论】:
如果是两个命令,则授予所有者读写权限并从组中删除执行权限,
chmod u +rw Test
chmod g -x Test
或者可以在一个命令中完成吗?
【问题讨论】:
要在 Linux 中更改目录权限,请使用以下命令:
chmod +rwx filename to add permissions.
chmod -rwx directoryname to remove permissions.
chmod +x filename to allow executable permissions.
chmod -wx filename to take out write and executable permissions.
r: Read permissions. The file can be opened, and its content viewed.
w: Write permissions. The file can be edited, modified, and deleted.
x: Execute permissions. If the file is a script or a program, it can be run (executed).
我们也可以更改使用数字
chmod 754 filename 7 个所有者(读写和执行),5 个组(读取和执行),4 个其他用户(只读)
【讨论】:
$ chmod u+rw,g-x Test
$ ls -ls Test
0 -rwx-----x 1 dave dave 0 Sep 30 09:28 Test
$ chmod -u-rw,g+x Test
$ ls -ls Test
0 ------x--- 1 dave dave 0 Sep 30 09:28 Test
$ chmod u+rw,g-x Test
$ ls -ls Test
0 -rw------- 1 dave dave 0 Sep 30 09:28 Test
【讨论】: