Home  >  Article  >  Operation and Maintenance  >  How to check which group you belong to in linux

How to check which group you belong to in linux

藏色散人
藏色散人Original
2020-05-15 11:05:045170browse

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.

How to check which group you belong to in linux

#2. Find Deepin Terminal and click Run Terminal.

How to check which group you belong to in linux

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.

How to check which group you belong to in linux

#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.

How to check which group you belong to in linux

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.

How to check which group you belong to in linux

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.

How to check which group you belong to in linux

#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.

How to check which group you belong to in linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn