Home > Article > Operation and Maintenance > How to check user's UID and GID in Linux
How to check the user's UID and GID in Linux: 1. Determine your own uid and gid by checking the "/etc/passwd" file, and check the command such as "cat /etc/passwd | grep xxx"; 2 , just check the current user's ID directly through the ID command.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
How to check the user's UID and GID in Linux?
linux View the user's uid and gid
cat /etc/passwd | grep your username
aaa@aaa:~/Desktop$ cat /etc/passwd |grep aaa aaa:X:1000:1000:aaa,:/home/aaa:/bin/bash
The two characters after x The numbers are uid and gid. Here uid is 1000 and gid is also 1000
(1) View the current user’s id
id
aaa@aaa:~/Desktop a$ id
id Username
aaa@aaa:~/Desktop$ id root uid=0(root) gid=0(root) group=0(root)
Linux video tutorial》
The above is the detailed content of How to check user's UID and GID in Linux. For more information, please follow other related articles on the PHP Chinese website!