Linux 基础命令 -- groupadd

命令介绍

命令:groupadd 添加群组

用法:groupadd [options] GROUP groupadd 群组

命令选项

[root@fp-21 ~]# groupadd --help
 
  -f, --force                   # 如果组已经存在,则成功退出,如果GID已被使用,则取消-G
  -g, --gid GID                 # 指定群组GID
  -h, --help                    # 帮助文档
  -K, --key KEY=VALUE           # 覆盖/etc/login.defs默认值
  -o, --non-unique              # 允许创建具有重复(非唯一)GID的组
  -p, --password PASSWORD       # 为新组使用此加密密码
  -r, --system                  # 创建系统帐户

命令实例

# 如果组已经存在,则成功退出,如果GID已被使用,则取消-G
[root@fp-21 ~]# grep "tom" /etc/passwd
tom:x:1000:1000::/home/tom:/bin/bash
[root@fp-21 ~]# groupadd -f tom

# 指定群组GID
[root@fp-21 ~]# groupadd -g 1222 test11
[root@fp-21 ~]# tail -1 /etc/group
test11:x:1222:

link 查看 Linux 基础命令

只有注入思想的博客才是好的博客

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章