How to use the command in Linux system to check whether a group name contains the specified user name

  
                

Under Linux, if you want to see if a group contains a specific username, you can use the command to implement it. Which command do you want to use? The following small series will introduce you how to use the command under Linux to see if the group contains a specific user name.

For Linux users, and in some cases, need to see a group name is specified whether to include a user name, they can use the following method:

Because users A group is added through the internal management page, but time synchronization is required, so it is necessary to check whether it has been synchronized on the server, that is, whether the specified user name is already included in the group

The method is as follows:

The code is as follows:

cat /etc/groups

Copyright © Windows knowledge All Rights Reserved