List the commands the current user is allowed or denied to run through sudo.
Do not run an administrative command.
Which command is appropriate?
sudo -l lists Defaults and the sudo policy that applies to the current user on the current host.
Detailed explanation
sudo -vIncorrect. -v validates credentials and updates the timestamp.
sudo -kIncorrect. -k invalidates the cached credential timestamp.
sudo -lCorrect. -l lists applicable sudo permissions.
su -Incorrect. su - starts another user's login shell.
Try it yourself
An example you can run in a temporary verification environment.
sudo --help 2>&1 | grep -E -- '-l|--list' | head -n 1Expected result
-lまたは--listの説明行Key points
- -l means list
- -v validates credentials
- Inspect policy
Notes
- Environment: sudo help / privilege command実行なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Permission bit
A mode bit controlling read, write, execute, or special execution behavior.
Account state
Attributes that determine whether a password or login account can be used.
Resource limit
A per-process or per-user ceiling such as open files or process count.