You are on page 1of 2

Linux vipw and vigr command

Updated: 04/26/2017 by Computer Hope

• About vipw and vigr


• vipw and vigr syntax
• vipw and vigr examples
• Related commands
• Linux and Unix commands help

About vipw and vigr


The vipw and vigr commands are used to edit the password, group, shadow-password, and shadow-
group files.

Description
The vipw and vigr commands edit the files /etc/passwd and /etc/group, respectively. If the -s flag is
specified, these commands will edit the shadow (secure) versions of their 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.

vipw and vigr syntax


vipw [options]

vigr [options]
Options
-g, --group Edit group database.
-h, --help Display help message and exit.
-p, --passwd Edit passwd database.
-q, --quiet Operate quietly.
-R, --root Apply changes in the CHROOT_DIR directory and use the configuration files
CHROOT_DIR from the CHROOT_DIR directory.
-s, --shadow Edit shadow or gshadow database.

Environment
The following environment variables affect the operation of the vipw and vigr commands:

VISUAL The editor to use.


EDITOR The editor to use if VISUAL is not set.

Files
/etc/group Group account information.
/etc/gshadow Secure group account information.
/etc/passwd User account information.
/etc/shadow Secure user account information.

vipw and vigr examples


vipw

Edit /etc/passwd.
vigr

Edit /etc/group.
vipw -s

Edit /etc/shadow.
vigr -s

Edit /etc/gshadow.

You might also like