How to list all locked account in linux? passwd -S user passwd -S -a | grep LK | cut -d " " -f1 cat /etc/passwd | cut -d : -f 1 | awk '{ system("passwd -S " $0) }'