vipw,vigr和vi的區別


vi

  • 編輯任意文件
  • 當文件以經被打開或者正在被編輯時,指示會提示,依然可以正常的修改和保存

vipw 編輯密碼文件,並且上鎖,其他人是無法修改成功的

  • vipw 會打開/etc/password文件,可以對其進行編輯

  • vipw -s :修改/etc/shadow文件

當刪除用戶出現如下錯誤的時候,可以使用以上兩個命令將用戶刪除,


userdel: user test is currently used by process 23578

其他命令

Usage: vipw [options]

Options:
  -g, --group                   edit group database
  -h, --help                    display this help message and exit
  -p, --passwd                  edit passwd database
  -q, --quiet                   quiet mode
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shadow                  edit shadow or gshadow database

VIPW(8)                                        System Management Commands                                       VIPW(8)

NAME
       vipw, vigr - edit the password, group, shadow-password or shadow-group file

SYNOPSIS
       vipw [options]

       vigr [options]

DESCRIPTION
       The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag, they will
       edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The programs will set the
       appropriate locks to prevent file corruption. When looking for an editor, the programs will first try the
       environment variable $VISUAL, then the environment variable $EDITOR, and finally the default editor, vi(1).

OPTIONS
       The options which apply to the vipw and vigr commands are:

       -g, --group
           Edit group database.

       -h, --help
           Display help message and exit.

       -p, --passwd
           Edit passwd database.

       -q, --quiet
           Quiet mode.

       -R, --root CHROOT_DIR
           Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.

       -s, --shadow
           Edit shadow or gshadow database.

ENVIRONMENT
       VISUAL
           Editor to be used.

       EDITOR
           Editor to be used if VISUAL is not set.

FILES
       /etc/group
           Group account information.

選擇使用什么編輯器打開

vigr 編輯用戶組文件 ,並且上鎖,其他人是無法修改成功的

  • vigr 修改/etc/groups文件
  • vigr -s 修改/etc/gshadow文件

Usage: vigr [options]

Options:
  -g, --group                   edit group database
  -h, --help                    display this help message and exit
  -p, --passwd                  edit passwd database
  -q, --quiet                   quiet mode
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shadow                  edit shadow or gshadow database


VIPW(8)                                        System Management Commands                                       VIPW(8)

NAME
       vipw, vigr - edit the password, group, shadow-password or shadow-group file

SYNOPSIS
       vipw [options]

       vigr [options]

DESCRIPTION
       The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag, they will
       edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The programs will set the
       appropriate locks to prevent file corruption. When looking for an editor, the programs will first try the
       environment variable $VISUAL, then the environment variable $EDITOR, and finally the default editor, vi(1).

OPTIONS
       The options which apply to the vipw and vigr commands are:

       -g, --group
           Edit group database.

       -h, --help
           Display help message and exit.

       -p, --passwd
           Edit passwd database.

       -q, --quiet
           Quiet mode.

       -R, --root CHROOT_DIR
           Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.

       -s, --shadow
           Edit shadow or gshadow database.

ENVIRONMENT
       VISUAL
           Editor to be used.

       EDITOR
           Editor to be used if VISUAL is not set.

FILES
       /etc/group
           Group account information.



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM