1. 命令格式:

         gpasswd [选项] 用户账号 组账号

  2. 命令功能:

         将用户加入到组

  3. 常见选项:

         -a  向组中添加的成员

         -d  删除组中的成员

         -M  同时向组中添加多个成员

  4. 常用范例:

    例一:将zhangsan加入到test组

    命令:  gpasswd -a zhangsan test

     

    例二:将用户zhangsan从test组中删除

    命令:  gpasswd -d zhangsan test

     

    例三:将zhangsan、lisi、wangwu加入到test组

    命令:  gpasswd -M zhangsan,lisi,wangwu test

    说明:同时将多个用户加入到组时,除了用选项-M,还需要将每个用户名用“,”隔开