命令格式:
gpasswd [选项] 用户账号 组账号
命令功能:
将用户加入到组
常见选项:
-a 向组中添加的成员
-d 删除组中的成员
-M 同时向组中添加多个成员
常用范例:
例一:将zhangsan加入到test组
命令: gpasswd -a zhangsan test
例二:将用户zhangsan从test组中删除
命令: gpasswd -d zhangsan test
例三:将zhangsan、lisi、wangwu加入到test组
命令: gpasswd -M zhangsan,lisi,wangwu test
说明:同时将多个用户加入到组时,除了用选项-M,还需要将每个用户名用“,”隔开
本文出自 “袁宇睿” 博客,请务必保留此出处http://928004321.blog.51cto.com/10707688/1731569
原文:http://928004321.blog.51cto.com/10707688/1731569