0
0
Linux CLIscripting~10 mins

whoami and id commands in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Using whoami and id Commands in Linux
📖 Scenario: You are working on a Linux system and want to learn how to find out your current username and user ID information using simple commands.
🎯 Goal: Learn to use the whoami command to display your current username and the id command to show your user ID, group ID, and group memberships.
📋 What You'll Learn
Use the whoami command to display the current username.
Use the id command to display user ID and group information.
💡 Why This Matters
🌍 Real World
Knowing your username and user ID is important for managing permissions and running commands with the right access on Linux systems.
💼 Career
System administrators and developers often need to check user identity and permissions quickly using these commands.
Progress0 / 4 steps
1
Display your current username using whoami
Type the command whoami to display your current username.
Linux CLI
Need a hint?

The whoami command shows the username you are logged in as.

2
Display your user ID and group information using id
Type the command id to display your user ID, group ID, and groups you belong to.
Linux CLI
Need a hint?

The id command shows detailed user and group information.

3
Use id command with your username
Use the command id $(whoami) to display the user ID and group information for your current username explicitly.
Linux CLI
Need a hint?

This runs id on the username returned by whoami.

4
Display only your user ID using id
Use the command id -u to display only your numeric user ID.
Linux CLI
Need a hint?

The id -u command shows only your user ID number. The exact number depends on your system.