Inspect alice's password-change date, minimum and maximum ages, warning period, and expiry without changing them.
Which command is appropriate?
chage -l lists password-aging and account-expiry information without changing it.
Detailed explanation
chage -M aliceIncorrect. -M requires a maximum-age value and changes the setting.
Incorrect. -M requires a maximum-age value and changes the setting.
passwd -l aliceIncorrect. passwd -l locks the password.
Incorrect. passwd -l locks the password.
usermod -e aliceIncorrect. -e is an expiry setting rather than a list operation.
Incorrect. -e is an expiry setting rather than a list operation.
chage -l aliceCorrect. chage -l displays the aging information.
Correct. chage -l displays the aging information.
Try it yourself
An example you can run in a temporary verification environment.
chage --help 2>&1 | grep -E -- '--list|-l,' | head -n 1Expected result
-lまたは--listの説明Key points
- -l means list
- Read-only
- Aging fields
Notes
- Environment: shadow-utils chage / 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.