Your First Linux Lab

LinuxBeginner
Practice Now

Introduction

Welcome to LabEx! In this lab, you'll get your feet wet with Linux. We'll cover the famous "Hello, World!" program and a few fundamental commands (echo, whoami, id) to understand your user identity. This is a Guided Lab, which provides step-by-step instructions to help you learn and practice. Follow the instructions carefully to complete each step and gain hands-on experience.

Click the Continue button below or the VM icon on the left to start the lab.

Continue to next step arrow

Hello LabEx

Let's get your computer to say hello! 😄 First up, the terminal. Think of it as your text-based command center for interacting with your computer.

To open the terminal:

  1. Look on the left side of your desktop.
  2. Find the Xfce Terminal icon.
  3. Click it!

The terminal window is where you'll type commands. It's a powerful tool and often a quicker way to accomplish many tasks in Linux than using a mouse.

Now, let's make it say hello! We'll use the echo command. echo simply repeats whatever you tell it to.

The best way to learn Linux (and programming in general) is by doing. Don't just passively read through this – try things out in the LabEx environment! It's the perfect place to experiment and learn.

Type this command into your terminal exactly as shown:

echo "Hello LabEx"

Press Enter.

Terminal displaying Hello LabEx

You should see "Hello LabEx" appear. Congratulations, you just ran your first Linux command!

Key things to remember:

  • Linux is case-sensitive: echo, Echo, and ECHO are all different.
  • Spaces matter. Make sure there's a space between echo and the quotation mark (").
  • The quotes tell echo precisely what string of text to repeat.

Tips: This Lab is part of the Linux Skill Tree, a structured knowledge system with various skills. After each step, the system verifies your actions, awarding skill points for correct responses.

Click Continue below to keep going. Labby will automatically verify your work.

Continue to next step arrow

Displaying the Current User

Let's find out who the computer thinks you are.

Type this command and press Enter:

whoami

Tips: Click "Explain Code" at the bottom right of the code block to chat with Labby AI for code clarification. After chatting with Labby, click "Continue" to return to the lab.

This is asking the computer, "Who am I?" It'll respond with your username.

You should see:

labex
Terminal showing whoami output

whoami is useful when you're working on different machines or using different accounts.

Keep going by clicking Continue below.

Displaying User and Group Information

Let's get some more user information with the id command. This is a cool way to see what groups you belong to.

In Linux, users are organized into groups. These groups determine the permissions and access rights a user has.

Type this command and press Enter:

id

You'll see something like:

uid=5000(labex) gid=5000(labex) groups=5000(labex),27(sudo),121(ssl-cert),5002(public)

Don't worry too much about the numbers right now. Here's the breakdown:

  • uid: Your User ID (a unique numerical identifier).
  • gid: Your primary Group ID.
  • groups: All the groups you are a member of.

You can also use id to look up other users. Try:

id root

You'll see:

uid=0(root) gid=0(root) groups=0(root)

root is the superuser – like the administrator of the system!

Don't be concerned if this seems a bit complex right now. You'll learn more about users and groups as you progress. Remember, practice makes perfect. The more you use these commands in LabEx, the more comfortable you'll become with them!

Click Continue to move on.

Extracting Your Username

In step 2, you used whoami to display your username. In step 3, you used id to display user and group information.

Sometimes id prints more detail than you need. A practical skill is learning how to ask for a specific piece of information.

Type this command and press Enter:

id -un

id -un prints only your username (the name for your current UID). You should see:

labex

Keep going by clicking Continue below.

After you click Continue, the script verification in this step is designed to fail on purpose, so you'll see an error message. This is expected.

When the error appears, click Re-Inspect. This triggers Deep Inspection, which uses AI to review your operation logs.

Follow the instructions shown by Deep Inspection (for example, re-run a command if asked). Once it passes, you can proceed to the next step.

Learn By Doing

Congratulations on completing your first hands-on lab! You've just experienced LabEx's core learning style: Learn By Doing.

What you just finished is a Guided Lab: clear steps plus automatic checks. Next, you can try Challenges, where you solve tasks with fewer hints to test what you learned.

Ask Labby

Deep Inspection helps when verification fails. During learning, you can also ask Labby questions anytime.

To use Ask, click the first Ask button under the Labby chat box. It will open an input field. Ask can understand your current lab context and your recent actions, so you can ask questions like:

  • "Where did I make a mistake, and how do I fix it?"
  • "Based on what I did in this lab, generate a learning report."
  • "Grade my performance in this lab and tell me how to improve."

Think of Labby as a one-on-one assistant you can talk to while you learn.

Click Continue to complete this lab.

Summary

Congratulations! You learned how to:

  • Open and use the terminal.
  • Use basic commands: echo, whoami, id.
  • Extract a specific identity detail with id -un.

This is just the beginning of your Linux journey! You've seen how powerful even simple commands can be. Ready to take your skills to the next level?

LabEx Pro is great value—less than $0.30 a day (under $2 a week), about the kind of spare change you might drop into a tip jar when grabbing coffee—and unlocks a whole new world of learning, including:

  • 6000+ Hands-On Labs
  • 2000+ Challenge Solutions
  • 400+ Real-World Projects
  • Certificates of Completion
  • Unlimited virtual machines
  • Full Access to Labby AI Assistant
  • Unrestricted Internet Access

Continue your Linux adventure with more free labs, or upgrade to LabEx Pro and become a Linux expert faster!