LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to find the number of users (https://www.linuxquestions.org/questions/programming-9/how-to-find-the-number-of-users-109348/)

mtest 10-28-2003 12:15 AM

how to find the number of users
 
can u tell how to find the number of users and their login names from root.

suppose if i issue ls /home. it is listing some other names such as lost+found, quota.user, quota.group etc along with the user names.
so can u tell how to find exactly the no of users in the system and their login names

gwp 10-28-2003 12:50 AM

Do a man on finger and who

#man finger
#man who

This will give all the options that you can use with these commands

try them:

# finger
# who

finger gives a lot more information, bu can be a security risk so could be disabled on your system. It seraches for files such as .plan, ..forward and .project to supply some
of the personal information

w is another one that you might want to check out

# w

BR

G

SaTaN 10-28-2003 02:27 AM

Quote:

Originally posted by gwp
Do a man on finger and who
#man finger
#man who
This will give all the options that you can use with these

I suppose this will give the info about all users who are currently logged in ->

Users who are not logged in will not be got by these commands

Code:

cat /etc/passwd | awk -F ":" '{print $1}'
gives you all users . However system users i.e, shutdown,apache so on will also be exhibited

SaTaN 10-28-2003 02:41 AM

Code:

cat /etc/passwd | awk -F ":" '{if($3>=500){print $1}}'
Maybe this will be a bit more near to what you want .
I suppose only "nfsnobody" is the user u don't want


All times are GMT -5. The time now is 06:15 PM.