Finding valid users

Is there a way to determine the names of valid system users? I know that last, finger, and who will give you the names of users who have accessed the system and / or those who are currently logged onto the system. I was trying to determine a way to find the names of any valid user whether or not they have logged onto the system currently or within the last week (finger, last)

The formal list of users is in /etc/passwd, active or not.

Hello

Try command 'logins'

Sharad

Thanks for the replies:
/etc/passwd does contain all the registered users but it is very difficult to pull out their names. Any thoughts???

I also tried logins ---- this doesn't work on my system

How about:
sed 's/:.*//' /etc/passwd

If you're using shadowed passwords, or (like in some BSD systems) master.passwd, you will need access to the version with the encrypted passwords in it. On a Linux system, using shadow passwords, do this as root:
awk -F: '{if($2 != "*") print $1}' /etc/shadow

Those are the users with some (or no) password set. This does not, however, check for users that have had their password expire...