首页 > 试题广场 >

在Linux系统下,有一个文件为"baidu.txt",如果

[单选题]
在Linux系统下,有一个文件为"baidu.txt",如果想为这个文件的所有者赋予可读和可执行权限,应该用下面那个命令?
  • chmod u+wx baidu.txt
  • chown u+wx baidu.txt
  • chmod 500 baidu.txt
  • chown 500 baidu.txt
  • chmod 101 baidu.txt
  • chown 101 baidu.txt

chmod是Linux下设置文件权限的命令:
u 表示该文件的拥有者,g 表示与该文件的拥有者属于同一个群体(group)者,o 表示其他以外的人,a 表示这三者皆是。
r=4,w=2,x=1

例子:
chmod a=rwx file === chmod 777 file
chmod ug=rwx,o=x file === chmod 771 file

解析:
chmod u+wx :文件拥有者添加写和执行的权限
500(读取+执行) :文件拥有者读+执行
101 ---x-----x  :u和o只有执行权限。

编辑于 2018-08-11 14:32:06 回复(1)
更多回答
A也是对的吧
发表于 2018-12-26 12:02:59 回复(2)