How to view all user and group information in linux

  1. [Step 1] cat /etc/passwd

    cat /etc/passwd to view all user information, the details are as follows

    How to view all user and group information in linux?
  2. 2

    [Step 2] cat /etc/passwd|grep username

    cat /etc/passwd|grep username, used to find a user, as shown below

    How to view all user and group information in linux?
  3. 3

    [Step 3] cat /etc/group

    cat /etc/group to view all group information, as shown below

    How to view all user and group information in linux?
  4. 4

    [Step 4] cat /etc/group|grep group name

    cat /etc/group|grep Group name, used to find a user group, as shown below

    How to view all user and group information in linux?
  5. 5

    [Step 5] Common commands for users and groups

    groups View the group members of the currently logged in user

    groups test View the group where the test user is located, and the members in the group

    whoami View the current login user name

    How to view all user and group information in linux?

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324863703&siteId=291194637