Discussion Locked

Counting unix accout

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
What command can find out how many user accounts in an Unix machine?

5 replies

by vinnyd

There is no built-in command to count the number of users accounts.

There is a command "who" that can tell you how many accounts are logged in.

In most versions on Unix in the /etc folder you will find the passwd file.

You can make a copy of it and then use the vi editor to delete all the system accounts.

Then go to the botton of the file.

use the vi command :nu

That will display the line number of the last line showing how many user accounts are configured.

by gazzb

Use the word count command on the /etc/passwd file :-

wc -l /etc/passwd

This will give you a numeric result including the system accounts. Just deduct the number of system accounts from this number (usually about 10)

This discussion is closed to new replies.