Hi all,
to find a user whether he had an account on AIX box i will use commands like
"finger" , "lsuser".
I am new to solaris and we are migrating to solaris.
now i am using " more /etc/passwd | grep -i <UserID> " to find a user present in that solaris box or not.
Are der any similar commands present in soalris .
Could any one please tell a command which will help me to list the user....
Thanks in advance.
Scott
July 21, 2010, 9:53am
2
Hi.
The id command is generally universally available.
"ID" only gives uid and primary group.... but i want to check all attributes for the user like shell and home dir and description as welll...
zaxxon
July 21, 2010, 9:56am
4
I guess the command id <username> is available on every Unix/Linux.
Using more on a file to pipe it into grep is no good usage. grep takes filenames as parameter directly. Also is more for page wise listing of a file.
You can try something like:
id jupp > /dev/null 2>&1 || echo 'User not found!'
1 Like
Scott
July 21, 2010, 9:58am
5
finger is also available on Solaris.
Also getent should be available.
1 Like
zaxxon
July 21, 2010, 9:58am
6
Just saw the answer. Then do a simple grep on the /etc/passwd like you already did but without that more and pipe.
I am sorry i guess i confused you ....
the main use is to display all the attributes of the user if user account exists....
zaxxon
July 21, 2010, 10:01am
8
Yeah, I was too slow to cope with^^
Anyway, maybe this is a help in future:
Rosetta Stone for Unix
You can mark the OS you want to compare and checkout which command you are looking for.
Scott
July 21, 2010, 10:02am
9
zaxxon:
Anyway, maybe this is a help in future:
Rosetta Stone for Unix
You can mark the OS you want to compare and checkout which command you are looking for.
Yes, of course
I never remember to mention that great link!
Heres a command I've found myself more frequently using:
logins -oxl <userid>
Easily to cut as well.