Junk Food for the Brain

Open Source and Awesomesauce :)

How to Print Usernames With a Userid Greater Than 500

| Comments

Occasionally, you need to print out a list of usernames, greater than a certain user id. This is usually useful an a slightly larger setup, or when you want to chain more commands to certain users.

Use the awk command.

awk -F":" ' $3 > 200  {print $1} '  /etc/passwd