Linux Survival Basics
Read-only, sensitive outputList Effective sudo Privileges
You need to see what sudo allows for the current user.
Command
sudo -l
Before you run this
System impact: Read-only. Output may expose users, paths, tokens, keys, IPs, process arguments, or log details.
When not to use it: Do not paste sudo output publicly without redacting hostnames and command paths.
Expected output
Allowed or denied sudo commands for the current account, after authentication if required.
System impact
Read-only, sensitive output. Nothing changes. The command reads current state and prints diagnostic evidence.
May require elevated permissions on protected paths or service-owned files.
Recovery / rollback: no state is changed.
When to use it
Use before editing sudoers rules.
When not to use it
Do not paste sudo output publicly without redacting hostnames and command paths.
Example run
Commands shown
These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.
sudo -lsudo -l
next steps
Related commands
List sudo Group Members
Before granting sudo, see who already has it.
getent group sudo
Read Recent Apache Error Log Lines
The Apache error log usually names the denied directory or rule.
sudo tail -80 /var/log/apache2/error.log 2>/dev/null || sudo tail -80 /var/log/httpd/error_log
Inspect Certbot Certificate Inventory
Know which names Certbot thinks it manages.
sudo certbot certificates
Read Recent Nginx Error Log Lines
The error log often names the denied path.
sudo tail -80 /var/log/nginx/error.log
Test Apache Config Without Reloading
Apache can check syntax before you reload a live site.
sudo apachectl configtest
next diagnostic step
Where to go from this command
- User not in sudoers hub Use before sudoers edits.
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.