1757022 Members
2053 Online
108858 Solutions
New Discussion юеВ

user account

 
Mridul Dutta
Advisor

user account

Hi friend ,


How to check the number of user account on a unix system ?

Mridul
12 REPLIES 12
RAC_1
Honored Contributor

Re: user account

/usr/sbin/logins -u -> need root privelages.
who -u -> current logins.
cat /etc/passwd -> system and user logins.

There might be nis/ldap users. You will have to check it on nis/ldap server.
There is no substitute to HARDWORK
AwadheshPandey
Honored Contributor

Re: user account

Every Unix System Has a /etc/passwd file in which each line shows a user entry. This is easy to count these lines. Some users are Deactivated, * entry in passwd field shows that this account is disabled.

Awadhesh
It's kind of fun to do the impossible
Sivakumar TS
Honored Contributor

Re: user account


Dear Mridul,

To check the no of users logged in

#who -q

To check the no of user accounts in a server

#cat /etc/passwd | wc -l

With REgards,

Siva.
Nothing is Impossible !
Muthukumar_5
Honored Contributor

Re: user account

you can check with /etc/passwd file. Execute logins or sam to get user details more. (super user power is needed)

-Muthu
Easy to suggest when don't know about the problem!
shridhar_1
Frequent Advisor

Re: user account

hi

try logins

shri
Arunvijai_4
Honored Contributor

Re: user account

Hi Mridul,

You can use SAM to get the number of user accounts in a HP-UX server, or you can use "logins" to find it out, but it will display all NIS accounts if it is configured as primary
in /etc/nsswitch.conf

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
MarkSyder
Honored Contributor

Re: user account

I'm interpreting this question differently from everyone else, so I'll give you my answer in case I'm right.

My understanding is that you want to know the user number of an individual user. Try:

grep username /etc/passwd

where username is the id of the user. The third field is the user number.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Tvs
Regular Advisor

Re: user account

Hi,

you can try

#logins

#logins -s ( to findout the system users)

#logins -u ( to findout the normal user)
regards
tvs
Cem Tugrul
Esteemed Contributor

Re: user account

Hi Mridul,

if i did not misunderstand you ,you wanted
to know "number" of user?
Then;
logins|wc -l
cat -n /etc7passwd
listusers|wc -l

Good Luck,

Pls do not forget to submit points!!!
:-)
Our greatest duty in this life is to help others. And please, if you can't