Considering that all users with id >= 1000
are non-system users, how can we get list of these users in a single command?
You need to get all users whose gid
is greater than or equals 1000. Use this command for that:
awk -F: '($3>=1000)&&($1!="nobody"){print $1}' /etc/passwd
If you want system users (gid<1000) it will be:
awk -F: '($3<1000){print $1}' /etc/passwd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With