Need to find user login name with their First name and last name

I need to find user login name with their First name and last name .Using HP-UX .
i used Finger but couldn't able to get ...

 [ttthps03:/home2]$ finger ravi.kumar@domain.com
ksh: domain.com:  not found
 
i tried with finger kumar ravi
finger ravi kumar but not able to get 
It just giving 
Login name: kumar                    In real life: ???
Help me out.

It gives whatever information you store about the user in passwd or NIS map..Are you sure you have the entire name in the passwd/NIS (whichever applicable)? In the example you quoted, you have got login name as kumar...

Looks like this user does not have his full name updated..

where i can find passwd/NIS

If the full names are stored in the 5th field of /etc/passwd you can try this:

awk -F: '$1="kumar"{print $5}' /etc/passwd

No i am not able to see the full list in the /etc/passwd

That why you dont see with finger. I am afraid you need to first update the user database with first and last names.

How to see the Records in NIS Map ?

Girija
NIS map is applicable only if you use NIS for user authentication and login. If NIS is configured you must see your NIS server-name as the output of 'ypwhich' command.

-Raja

In HP-UX.

For one user (excluding system users).

listusers -l <loginname>

For all users:

listusers

If you want to process the data in a script the output from "logins" with "-o" option is easier to work with.

logins -ox -l <loginname>
1 Like

Its a grt Command ....Thanks a lot
But even though i am not able to see all the users ............i think it also taking it from passwd command