How to list user detail info in Solaris?

How to list user detail info in Solaris?

Post by Chandl » Sun, 11 Nov 2001 01:54:53



How can I list user's detail info, like group, gecos, login shell, etc., in solaris.

I know the /etc/passwd file have them all, but what I need is a command.

Thanks.

 
 
 

How to list user detail info in Solaris?

Post by Drazen Kac » Sun, 11 Nov 2001 02:18:24



>  How can I list user's detail info, like group, gecos, login shell,
>  etc., in solaris.

>  I know the /etc/passwd file have them all, but what I need is a command.

getent passwd <username>

--
 .-.   .-.    Errors have been made. Others will be blamed.
(_  \ /  _)

     |

 
 
 

How to list user detail info in Solaris?

Post by Rich Tee » Sun, 11 Nov 2001 02:16:17



Quote:> How can I list user's detail info, like group, gecos, login shell, etc., in solaris.

> I know the /etc/passwd file have them all, but what I need is a command.

grep <username> /etc/passwd.

--
Rich Teer

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

How to list user detail info in Solaris?

Post by Tony Walto » Sun, 11 Nov 2001 02:15:31



> How can I list user's detail info, like group, gecos, login shell, etc., in solaris.

> I know the /etc/passwd file have them all, but what I need is a command.

"List" in what sense?

grep username /etc/passwd

will show you lines containing that username - you can start getting
fancy with constructions like

grep "^username" /etc/passwd

if you want to see only lines starting with that username - to avoid
things like

grep username /etc/passwd
foo:x:9999:123:My very own username:/home/blah:

If you want to split the lines up like

username: boggly
uid: 12345
gid: 65
gcos: Boggly the user
home: /home/bogglyplace
shell: /bin/ash

then Perl or awk are probably the best tools to use to write a script to
do it - there's no built-in command for this.

--
Tony

 
 
 

How to list user detail info in Solaris?

Post by Andrew J Caine » Sun, 11 Nov 2001 17:51:34


# logins -l joeuser
joeuser        1005   staff        10      Joe User, Users Group, x1234

# logins -axl joeuser
ajcaines        1005    staff       10      Joe User, Users Group, x1234
                        /home/joeuser
                        /bin/csh
                        PS 091100 -1 -1 -1
                        -1 000000

# id -a joeuser
uid=1005(joeuser) gid=10(staff) groups=80(www)

# finger joeuser
Login name: joeuser                    In real life: Joe User
Directory: /home/joeuser               Shell: /bin/csh
On since Nov  9 09:56:55 on pts/5 from some.other.system
Mail last read Sat Nov 10 03:40:00 2001
Project: The Users Project
Plan:
To make the sysadmin's life a misery.

-Andrew-
--
 _______________________________________________________________________

| "They that can give up essential liberty to obtain a little temporary |
|  safety deserve neither liberty nor safety" - Benjamin Franklin, 1759 |