https://drive.google.com/file/d/1ORD8tMMJ8bWN5RaLojE9m9-S7HmOYMqF/view?usp=sharing
These commands help you identify who you are, who is logged in, and your user/group IDs.
whoami # Shows current username
who am i # Shows your login session (terminal, time, etc.)
w # Lists all logged-in users and their activities
id # Shows your UID, GID, and groups
id username # Shows UID/GID/groups for a specific user
whoami
# Output: zybi
id zybi
# Output: uid=1001(zybi) gid=1001(zybi) groups=1001(zybi),1002(developer)
Run all four commands:
whoami
who am i
w
id
susu (switch user) lets you become another user (default: root).su - (or su -l) starts a login shell—loads the target user’s environment ($HOME, $PATH, etc.).su username # Switch to user (non-login shell)
su - username # Switch with full login environment
su # Switch to root (non-login)
su - # Switch to root (login shell)
exit # Return to previous user
su - root # Become root with root's environment
pwd # Now in /root
exit # Back to original user