linux_组操作

来源:互联网 发布:软件需求分析阶段 编辑:程序博客网 时间:2024/06/05 05:54

0.假设有一个用户test

1.显示当前用户所属组:

#id

或者

#id test

#id -Gn

2.添加新组:

#groupadd helloworld

3.删除已有组:

#groupdel helloworld

4.向已有组helloworld中添加用户test:

#gpasswd -a test helloworld

5.从已有组helloworld中删除用户test:

#gpasswd -d test helloworld

6.改变文件夹modify属主:所属组从test:test到root:helloworld

#chown root:helloworld modify/ -R

0 0