How to view users in unix

Hi,

Im newbie here and in unix as well. How can i view users in unix? Im viewed them in shadow file (i typed: vi /etc/shadow) but some unix (im confused if its unix or linux or bsd, but i think it has a little thing in common or differnce) has no shadow file?! What must i do to view the users list??? Pls help me!

Thanks! Your response is greatly appreciated!

By the way, if this question had been answered please redirect me to that topic. I tried to search my question here in our forum but i didnt see an answer to my question!

Thanks!

More power!

/etc/passwd

Thank you very much!

Take care with vi and files like /etc/shadow and etc/password - they're sooo easy to break! If you've got a modern unix then "lsuser ALL" will give you a nice (safe) listing.

cheers

Yeah, thats the first thing I heard about unix. "Almost all or even all files are not just file, they are system files so be carefull in deleting them".

Thanks thestevew for the info and reminders!

You can also use awk.

awk -F: '{ print $1 }' /etc/passwd

You can change the value to list anything from the password file. For example, this will show all UID in /etc/passwd file:

awk -F: '{ print $3 }' /etc/passwd