You can check for a user's groups by using the groups command or the id command. Here are both methods:
- Using the
groupscommand:
groups username
Replace username with the actual username you want to check. This will list all the groups that the user belongs to.
- Using the
idcommand:
id username
This command will display the user's UID, GID, and all the groups they are a member of, along with their corresponding IDs.
For example, to check for a user named john, you would run:
groups john
or
id john
