Click to See Complete Forum and Search --> : User listing method


hauwkim
02-22-2005, 04:40 AM
Hi

Is there a way I can list out all the users that I have created on my linux box.

I have googled and so far what I have found out is the who command which will only display a list of currently log in users

Thanx in advance

mrBen
02-22-2005, 05:55 AM
cut -d ':' -f 1 </etc/passwd


(This prints out the first column of the /etc/passwd file, which holds all the user settings for the users, the first column being their username)

phlipant
02-22-2005, 10:44 AM
ls /home

Notice the two commands give different results, the first for all users, the second for users that log in manually.

hauwkim
02-22-2005, 09:48 PM
After somemore digging I've manage to find another command that does the same thing as awk -F":" '{ print $1 }' /etc/passwd

Actually I did a ls /home

But when I try to change the users passwd it complains that the user does not exist

Gues I will have to use userdel -r when I delete a user next time


Thankx a million guys