Determine whether alice's password is usable, locked, or unset and view an aging summary without modifying it.
Which command is appropriate?
passwd -S displays a concise password status and aging summary without changing the account.
Detailed explanation
passwd -l aliceIncorrect. -l changes the password state by locking it.
Incorrect. -l changes the password state by locking it.
passwd -u aliceIncorrect. -u changes the state by unlocking it.
Incorrect. -u changes the state by unlocking it.
passwd -d aliceIncorrect. -d removes the password field.
Incorrect. -d removes the password field.
passwd -S aliceCorrect. passwd -S reports the status.
Correct. passwd -S reports the status.
Try it yourself
An example you can run in a temporary verification environment.
passwd --help 2>&1 | grep -E -- '--status|-S,' | head -n 1Expected result
-Sまたは--statusの説明Key points
- -S means status
- Read-only
- Lock state
Notes
- Environment: shadow-utils passwd / help読取のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.