[plug] User accounts list from command line?

Craig Ringer craig at postnewspapers.com.au
Wed Jul 9 20:31:14 WST 2003


> What command lists all the user accounts on a linux (redhat8 in this case) system?

getent passwd

If you're only using basic user accounts defined in /etc/passwd you can 
'cat /etc/passwd' instead, but getent will agreggate accounts from local 
accounts, LDAP, NIS, etc into one list.

If you want just the accounts, you'll want to

getent passwd | cut -d ':' -f 1 | sort

Craig Ringer




More information about the plug mailing list