Home >Operation and Maintenance >Linux Operation and Maintenance >How to check which group you belong to in linux
#How to check which group it belongs to in Linux?
There are many users in the Linux system. I want to know which user group a certain user is in. How to check?
Let’s take a look at the detailed tutorial.
Recommended: "linux tutorial"
1. First, open the "Launcher" on the taskbar.
#2. Find Deepin Terminal and click Run Terminal.
Method 1, groups command method
The groups command can view the user groups to which a user belongs. Only execute the groups command to view the currently logged in users of the system. user group.
#To query the user group to which a specific user belongs, you can follow the user. As shown in the figure below, query the user group where the air user belongs.
Method 2. View /etc/group method
/etc/group is the user group configuration file. You can view this file and query a certain file through the grep command. The user group the user belongs to. As shown in the figure below, it is found that the air user belongs to the air and sudo user groups.
Method 3, id command method
The id command can also check the user group to which a user belongs. Only execute the id command to check the currently logged in user. The user group it belongs to.
#To query the user group to which a specific user belongs, you can follow the user. As shown in the figure below, query the user group where the air user belongs.
The above is the detailed content of How to check which group you belong to in linux. For more information, please follow other related articles on the PHP Chinese website!