Print the names of the groups a specific user is in.
groups [OPTION]... [username]...
--help # Display help information and exit.
--version # Display version information and exit.
username (optional): One or more usernames. If not provided, the command defaults to the current user.
Returns 0 on success and a non-zero value on failure.
Display the groups for the user linux:
[root@localhost ~]# groups linux
linux : linux adm dialout cdrom plugdev lpadmin admin sambashare
id -Gn./etc/passwd and potentially other groups specified in /etc/group.GNU coreutils package. For more information, see man -s 1 groups or info coreutils 'groups invocation'.