On Unix-like operating systems, the vipw and vigr commands are used to edit the password, group, shadow-password, and shadow-group files.

This page covers the Linux versions of vipw and vigr.

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 sets 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.

  • Description
  • Syntax
  • Environment
  • Files
  • Examples
  • Related commands
  • Linux commands help

Syntax

vipw [options]

vigr [options]

Options

Environment

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

Files

Examples

vipw

Edit /etc/passwd.

vigr

Edit /etc/group.

vipw -s

Edit /etc/shadow.

vigr -s

Edit /etc/gshadow.

addgroup — Add a group to the system.adduser — Add a group to the system.groupadd — Add a group to the system.useradd — Add a user to the system.passwd — Change a user’s password.vi — Text editor based on the visual mode of ex.visudo — Safely edit the sudoers file.