LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

vigr

Edit the group or shadow-group file with locking

TLDR

Edit the /etc/group file
$ sudo vigr
copy
Edit the /etc/gshadow (shadow group) file
$ sudo vigr -s
copy
Edit group files in a chroot environment
$ sudo vigr -R [/path/to/chroot]
copy

SYNOPSIS

vigr [options]

DESCRIPTION

vigr edits the `/etc/group` file (or `/etc/gshadow` with -s) while setting appropriate locks to prevent file corruption from concurrent access. It first locks the file, creates a temporary copy, opens it in the user's preferred editor (checking `$VISUAL`, then `$EDITOR`, falling back to `vi`), performs syntax checks after editing, and then atomically replaces the original file.

PARAMETERS

-g, --group

Edit the group database (default).
-s, --shadow
Edit the gshadow (shadow group) database.
-p, --passwd
Edit the passwd database (equivalent to running vipw).
-q, --quiet
Quiet mode.
-R, --root CHROOTDIR_
Apply changes in a chroot environment.
-h, --help
Display help message.

INSTALL

sudo apt install passwd
copy
sudo pacman -S shadow
copy
sudo apk add shadow
copy
sudo zypper install shadow
copy
nix profile install nixpkgs#shadow
copy

CAVEATS

The vigr command should always be used instead of directly editing `/etc/group` to prevent file corruption from concurrent access. Changes take effect immediately. Requires root privileges. If you edit `/etc/group`, you should also check `/etc/gshadow` for consistency by running `vigr -s`.

HISTORY

vigr is part of the shadow-utils package, providing safe editing of group files similar to how vipw edits password files.

SEE ALSO

vipw(8), group(5), gshadow(5), groupadd(8), groupmod(8), groupdel(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid