Linux Survival Basics
Read-only, sensitive outputCheck a User Identity Record
You need UID, primary group, and supplementary groups for a user.
Command
id username
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 run the command against the sample username; replace it with the target account first.
Expected output
UID, GID, and group memberships for the target username.
System impact
Read-only, sensitive output. Nothing changes. The command reads current state and prints diagnostic evidence.
Recovery / rollback: no state is changed.
When to use it
Use before editing sudoers or adding group membership.
When not to use it
Do not run the command against the sample username; replace it with the target account first.
Example run
Commands shown
These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.
id usernameid username
next steps
Related commands
Show User Groups
Group membership explains many sudo and access failures.
groups username
List sudo Group Members
Before granting sudo, see who already has it.
getent group sudo
List Effective sudo Privileges
sudo -l shows policy; guessing invites bad access changes.
sudo -l
Check Owner and Mode in One Line
The file existed. The owner and mode explained why it still failed.
stat -c '%A %U:%G %n' /var/www/example/index.html
Inspect One Process Open Files
Look at one target process, not the whole host, when pressure is scoped.
sudo lsof -p 1234 | head
next diagnostic step
Where to go from this command
- User not in sudoers hub Use for sudo access triage.
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.