how to list locked users in hp-ux?

Actually.I have 2 questions to ask.

  1. how to list locked account in hp-ux?

2.how to list locked account in linux(redhat)?
I can use the command "passwd -S -username" to list a account who were locked .
who knows how to list all locked accounts with one command.

Thanks!!

how about:

for user in `cut -d ':' -f1 /etc/passwd`; do echo -n "checking $user ... " ;   passwd -S $user; done

tried with RHEL. no idea about HP-UX

thanks for replying.
It works.
Can anyone give me the answer to the question1?

This works for me on HP-UX 11.11

oldIFS="$IFS"
IFS=:
while read user garbage
do
passwd -s $user
done < /etc/passwd | grep "LK"
IFS="$oldIFS"

For HPUX, process the output from the following "logins" command: Locked accounts contain "LK" in the 8th ":" delimited field.

logins -xto

Hi,

If you are root, try ' passwd -r files -s -a ' this will give you a list of all accounts that are locked. My systems are trusted, so not sure what would work on an untrusted hpux system.

Leslie