L-001

User Identity

← Script House
student@hexworth:~
Welcome to Hexworth Linux Lab L-001!
This lab teaches you how to identify your user account and group memberships.
Type commands below and press Enter to execute.
Start with whoami to see your username.
student@hexworth:~$

Current Task

1
2
3

Display Your Username

Use the whoami command to show your current user identity

$ whoami

Learning Guide

Why User Identity Matters

In Linux, every process runs as a specific user. Knowing your identity helps you understand:

  • What files you can access
  • What commands you can run
  • What permissions you have

Command: whoami

The simplest way to check your username. Returns just the username - nothing more.

$ whoami
student

Command: id

Shows your User ID (UID), primary Group ID (GID), and all group memberships.

$ id
uid=1000(student) gid=1000(student) groups=1000(student),27(sudo),100(users)
Breaking Down the Output:
uid=1000(student) - Your User ID and username gid=1000(student) - Your primary Group ID groups=... - All groups you belong to

Command: groups

Lists all groups you're a member of in a simple format.

$ groups
student sudo users docker
Real-World Use

System administrators use these commands to verify user permissions before troubleshooting access issues. If a user can't access a file, checking id reveals if they're in the required group.

Security Note

The sudo group grants administrative privileges. If you see it in your groups, you can run commands as root using sudo.