1755601 Members
3755 Online
108836 Solutions
New Discussion юеВ

user uid

 
SOLVED
Go to solution
Chern Jian Leaw
Regular Advisor

user uid

HI
Is there a way in which the id command could be specified to display the uid of any other users, besides only displaying the uid of the current user which had invoked the following ?:
$id

I'm running $id as root, but whenever I tried displaying the uid of other users, it would only display the uid of the current user, i.e myself.

5 REPLIES 5
Animesh Chakraborty
Honored Contributor

Re: user uid

Hi
Try
#id user
id followed by user name,it will display the user id of that perticular user.
Hope that is what you are looking for.
Did you take a backup?
Deepak Extross
Honored Contributor
Solution

Re: user uid

id
should work.

Else, try
grep /etc/passwd
The third field is the user-id.
Michael Tully
Honored Contributor

Re: user uid

Hi,

You must state the userid name or number as well in the same argument.

# id tully
uid=105(tully) gid=20(users) groups=1(staff)

Have a look at the man page for 'id' for further options.

Cheers
~Michael
Anyone for a Mutiny ?
T G Manikandan
Honored Contributor

Re: user uid

Hello,
If you are working as super-user
you can use the
#logins
command to find out all the usernames,their groups,uid,gid
Also you can use
cat /etc/passwd|awk -F ":" '{print $1,$3}'
(to have the username and uid's).

THanks
John Strang
Regular Advisor

Re: user uid

If you want more information about a user you can run
finger
But unfortunately this does not display the uid

John
If you never make a mistake you'll never make anything.