使用方法

调用chgrp的语法为

chgrp 组名 目标1 [目标2 ...]
  • "组名"是文件即将关联的组。
  • "目标1 [目标2 ...]"是需要改变组的文件或目录的列表。


备注:"组名"既可以使用字符名称也可以使用ID。

范例

$ls -l testfile
-rw-r--r--   1 unixguy  staff           545 Nov 04 2004  ttt
$chgrp system testfile
$ls -l ttt
-rw-r--r--   1 unixguy  system          545 Nov 04 2004  ttt

上述命令将文件"testfile"所属的组从"staff"改成了"system"。(执行命令者必须属于"staff"组。)

相关文章:

  • 2021-07-11
  • 2022-01-30
  • 2021-12-30
  • 2022-12-23
  • 2021-12-18
  • 2021-12-20
  • 2021-11-27
  • 2022-12-23
猜你喜欢
  • 2021-11-05
  • 2022-01-01
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
相关资源
相似解决方案