2 ms·
There might be off by one error. On my system the following works: awk -F: '$7=="/usr/sbin/nologin" {print $1}' /etc/passwd Or awk -F: '$7 ~ /bin\/nologi
by d0mine 15y ago
There might be off by one error. On my system the following works:
awk -F: '$7=="/usr/sbin/nologin" {print $1}' /etc/passwd
Or
awk -F: '$7 ~ /bin\/nologin$/ {print $1}' /etc/passwd
- irahul 15y agoYes, indeed it should be $7 instead of $6. I didn't run it when I posted the comment. I just copied it from the article.