LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

group

System group database file

TLDR

View group file
$ cat /etc/group
copy
Find groups for user
$ groups [username]
copy
Find group by name
$ getent group [groupname]
copy
List group members
$ getent group [groupname] | cut -d: -f4
copy

DESCRIPTION

/etc/group is the system file that defines groups and their members. Each line contains a group entry with four colon-separated fields: group name, password placeholder, numeric GID, and a comma-separated list of member usernames.Groups control file access permissions and are fundamental to Unix security. Users can belong to multiple groups, with one primary group set in /etc/passwd.

FILE FORMAT

$ groupname:password:GID:members
copy
Fields:- groupname: Group name- password: Usually 'x' (see /etc/gshadow)- GID: Numeric group ID- members: Comma-separated list of users

RELATED COMMANDS

$ groupadd groupname      # Create group
groupdel groupname      # Delete group
groupmod -n new old     # Rename group
gpasswd -a user group   # Add user to group
gpasswd -d user group   # Remove user from group
newgrp groupname        # Switch primary group
copy

CAVEATS

Direct editing not recommended; use groupadd/groupmod. Changes may require logout to take effect. GIDs below 1000 typically reserved for system groups.

SEE ALSO

groups(1), groupadd(8), groupmod(8), passwd(5)

RESOURCES

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