经常会用到的命令,记一下。

1.chgrp修改文件所属组

#简单使用,将文本test.txt所属组改为gourp1

chgrp gourp1 test.txt

2.chown修改文件拥有者

#将test.txt文件所属用户修改为user1

chown user1 test.txt 

#同时修改test.txt的所属用户和所属组

chown user1:group1 test.txt

3.chmod修改文件属性

chmod 755 test

chmod u+x test

chmod u-x test

chmod g+x test

4.usrmod修改用户所属组

一般的话只是将当前用户添加到其它组中去

usrmod -a -G group1 user1

如果要彻底更改用户所属的组的话使用

usrmod -g group1 user1

相关文章:

  • 2021-06-30
  • 2021-09-08
  • 2022-01-21
  • 2022-12-23
  • 2021-08-10
  • 2021-12-06
猜你喜欢
  • 2021-11-28
  • 2021-11-23
  • 2022-12-23
  • 2021-05-22
  • 2021-12-24
  • 2021-06-10
  • 2022-12-23
相关资源
相似解决方案