QuestionQ84

VerifiedNetwork Defense Management

John works as a network administrator at an IT company and wants to prevent unauthorized users from misusing accounts. He must ensure that no accounts have blank passwords. Which command does John use to list every account with an empty password?

Explanation

In /etc/shadow, fields are colon-separated and the password field is the second field. awk -F: sets : as the field separator, and ($2 == "") selects records whose second field is empty. GNU Awk documents -F as the option for setting the field separator.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!