If groups is run without arguments, it writes the groups that the present process belongs to.
$ whoami robot $ groups hive
If groups is run with a user as an argument, it writes the groups that the named user belongs to.
$ whoami robot $ groups robot hive dockingbay command
This would be a user "robot", belonging to groups "hive," "dockingbay," and "command." The last two groups, "dockingbay," and "command," are likely suplementary groups, that can be activated with su or newgrp.
All of these relate to user information.
- id - dump UID and GID information, more powerful than this one, providing more information.
- logname - show the login name.
- whoami - show effective user ID.
- users - show who is logged in.
- who - show who is logged in from where.