groups

Prints the name of the group to which the specified user belongs.

Summary

groups [OPTION]... [username]...

The main purpose

Options

--help Display help information and exit.
--version Display version information and exit.

Parameters

username (optional): It can be one or more. If not provided, it defaults to the current user.

return value

Returning 0 indicates success, returning a non-zero value indicates failure.

example

Display the groups to which the linux user belongs

[root@localhost ~]# groups linux
linux: linux adm dialout cdrom plugdev lpadmin admin sambashare

Notice