Awk to get all my regular users in shadow
You need to escape the $
, as it is a special char for "End of Line" much like ^
is "Beginning of Line".
sudo getent shadow | awk -F: '$2 ~ /^\$/ || $2 ~ /^!\$/ {print $1}'
All users with a password set can be listed like this:
getent shadow | egrep '^[^:]*:[*!]:' -v | cut -f1 -d: