群組更名

  1. 增加 deyugrp 群組。
    [root@kvm7 ~]# groupadd deyugrp
    
  2. 查詢 deyugrp 群組。
    [root@kvm7 ~]# getent group deyugrp
    deyugrp:x:1000:
    
  3. 使用 groupmod 變更群組名稱,先查看輔助說明,選項 -n 可以變更群組名稱。
    [root@kvm7 ~]# groupmod --help
    Usage: groupmod [options] GROUP
    
    Options:
      -g, --gid GID                 change the group ID to GID
      -h, --help                    display this help message and exit
      -n, --new-name NEW_GROUP      change the name to NEW_GROUP
      -o, --non-unique              allow to use a duplicate (non-unique) GID
      -p, --password PASSWORD       change the password to this (encrypted)
                                    PASSWORD
      -R, --root CHROOT_DIR         directory to chroot into
    
  4. 使用 groupmod 將群組 deyugrp 變更為 sharegrp。
    [root@kvm7 ~]# groupmod -n sharegrp deyugrp
    
  5. 查詢 deyugrp 群組。
    [root@kvm7 ~]# getent group sharegrp
    sharegrp:x:1000: