-
[Step 1] cat /etc/passwd
cat /etc/passwd to view all user information, the details are as follows
-
[Step 2] cat /etc/passwd|grep username
cat /etc/passwd|grep username, used to find a user, as shown below
-
[Step 3] cat /etc/group
cat /etc/group to view all group information, as shown below
-
[Step 4] cat /etc/group|grep group name
cat /etc/group|grep Group name, used to find a user group, as shown below
-
[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
Ranking