LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Putting together a list of user accounts. (https://www.linuxquestions.org/questions/linux-general-1/putting-together-a-list-of-user-accounts-404033/)

kemplej 01-16-2006 10:15 AM

Putting together a list of user accounts.
 
I am looking to put a list of all the user accounts I have (I have over 300 users) together into a txt file for viewing along with their name on their account (its for a isp). How would i do that?

marozsas 01-16-2006 10:47 AM

Some systems assign users a UID>100, others UIDs are >500, or even 1000. Look what is the lowest UID for a regular user in your system. Let say it is above 1000, like mine.

Code:

cat /etc/passwd | awk -F: '{if ($3>1000) print $0}' | grep -Ev "nfsnobody|otherunwanteduser1|otherunwanteduser2" | awk -F: '{printf "%s - real name: %s\n", $1, $5}'


All times are GMT -5. The time now is 05:21 AM.