What does the whoami command do?
Displays the username of the currently logged-in user.
Why is whoami useful?
For confirming active session identity.
Example command for whoami?
whoami
Example output for whoami?
admin
What does the id command display?
Detailed information about the current user.
What details does id include?
User ID (UID), group ID (GID), and group memberships.
Why is id useful?
Managing file permissions and troubleshooting access issues.
Example command for id?
id
Example output for id?
uid=1001(admin) gid=1001(admin) groups=1001(admin),27(sudo)
What is UID?
The user’s unique identifier.
What is GID?
The primary group’s identifier.
What does groups command show?
All groups the current user belongs to.
Why use groups command?
To verify user access and permissions.
Example command for groups?
groups
Example output for groups?
admin sudo
What does getent passwd do?
Queries the system’s user database for all user entries.
What data does getent passwd retrieve?
Data for both local and networked users.
Why is getent passwd useful?
Auditing and troubleshooting user-related issues.
Example command for getent passwd?
getent passwd
Example output for getent passwd?
admin:x:1001:1001:Admin User:/home/admin:/bin/bash
What details are included in getent passwd output?
Username, UID, GID, home directory, and login shell.