Originally posted by amitsharma_26
cat /etc/passwd |grep 500*
It will list all the users with UID 500 or above.
That's not entirely true. That grep pattern will match 50, 500-509, 5000-5099, etc. It won't list users with ID's of 510-4999. Also, different distributions use different starting points for beginning UIDs. 500 is pretty common, but I've seen some that start at 1000. A slightly improved version of the command above would be:
cat /etc/passwd | cut -d: -f 1,3,6 | grep "[5-9][0-9][0-9]"
That's not perfect, but it would list UIDs of 500-999. And it would prevent any matching of numbers in comment or GID fields.
Then it could be combined with homey's suggestion for something like this:
cat /etc/passwd | cut -d: -f 1,3,6 | grep "[5-9][0-9][0-9]" | grep "/home" | cut -d: -f1
But now it's getting to be a pretty long command, and not the easiest to remember. Alias time