archwhite
12/2/2016 - 10:02 AM

3 ways to get all users in linux

3 ways to get all users in linux

# 1st way
awk -F: '$0=$1 " uid="$3' /etc/passwd
# 2nd way
awk  -F':' '$3>999 {print $1 " uid: " $3}' /etc/passwd | column -t | grep -v nobody
# 3rd way
cut -d: -f1 /etc/passwd