How to check for a user's groups?

You can check for a user's groups by using the groups command or the id command. Here are both methods:

  1. Using the groups command:
groups username

Replace username with the actual username you want to check. This will list all the groups that the user belongs to.

  1. Using the id command:
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

0 Comments

no data
Be the first to share your comment!