Operating System - Linux
1755766 Members
2893 Online
108838 Solutions
New Discussion юеВ

Re: id number of users and groups

 
SOLVED
Go to solution
Tonatiuh
Super Advisor

id number of users and groups

RH AS 2.1

How can I know the id (number) of a user and group?
4 REPLIES 4
Paul Cross_1
Respected Contributor
Solution

Re: id number of users and groups

The UID (user) and GIDs (group) are the third field (separated by colons) in the /etc/passwd and /etc/group files respectively.
They are world readable in case you don't have advanced privileges.
Vid Luther
Advisor

Re: id number of users and groups

you can also type `id username`
to get it in a much readable format.
Ivajlo Yanakiev
Respected Contributor

Re: id number of users and groups

also try that:

grep username /etc/password
Michael Williams_6
Trusted Contributor

Re: id number of users and groups

Minor point, but if you're using a NIS or LDAP authentication server, then the best method is:

getent {passwd or group} {name of user or group you're looking for}

So if I wanted to find the id for user michaelw, it would be:

getent passwd michaelw

And similarly for group users

getent group users