Chapter 1 · Lesson 3

Setting Up Your Linux Environment

You can read about Linux all day, but it only clicks once you have a living terminal in front of you. In this lesson we get you a real, working Linux environment — on your own machine or in the cloud — and you'll type your very first commands.

Imagine it's your first day on a DevOps team. Someone drops you a link to a server and says, "Can you check why disk usage is climbing on web-03?" There's no fancy app, no dashboard — just a black window with a blinking cursor and a prompt that reads you@web-03:~$. That prompt is where almost all real Linux work happens, and the goal of this lesson is to put one of those prompts on your screen today. Once it's there, every other lesson in this course becomes something you do, not just something you read.

The good news: you don't need to wipe your laptop or buy anything. There are three friendly on-ramps, and you only need one to keep moving. Let's look at them, pick yours, and get you to a prompt.

Three paths to a Linux prompt

Whether you're on Windows, macOS, or a Chromebook, there's a comfortable way in. They all end in the same place — a Bash shell — so don't agonize over the choice. Pick the one that matches your machine and move on.

Three ways to get a Linux terminal A comparison of three paths to a Linux prompt: WSL on Windows, a virtual machine in VirtualBox or VMware, and a cloud instance, all converging on the same shell prompt. Three ways to reach a Linux prompt WSL Linux inside Windows Fast · no VM overhead wsl --install Virtual Machine VirtualBox / VMware Full desktop · isolated Boots an Ubuntu ISO Cloud Instance AWS · Azure · GCP Nothing to install Reach via SSH bash — the same shell user@linux:~$ whoami Whichever path you pick, you land at the very same Bash prompt.
Three on-ramps, one destination: WSL, a virtual machine, and a cloud instance all drop you at the same Bash prompt.

WSL (Windows Subsystem for Linux) runs a genuine Ubuntu inside Windows with almost no overhead — no separate desktop, no rebooting. If you're on Windows 10 or 11, this is the easiest and fastest path, and it's what most Windows-based DevOps engineers use day to day.

A virtual machine runs a complete, isolated Linux computer in a window using software like VirtualBox (free) or VMware. You get the full Ubuntu desktop, and because it's sandboxed you can break things freely. It uses more memory and disk, but it's the most "real Linux" feel on any host OS, including macOS.

A cloud instance is a Linux server you rent from AWS, Azure, Google Cloud, or a smaller host. There's nothing to install locally — you connect over the network with SSH. Many providers have a free tier, and this mirrors exactly how you'll touch real production servers later.

💡 Which should I pick?
  • On Windows? Use WSL — it's the path of least resistance.
  • On macOS or want a full desktop? Use a VirtualBox VM with Ubuntu.
  • Low-spec laptop or just curious? Spin up a free-tier cloud instance and SSH in.

Standing up Ubuntu

We'll use Ubuntu throughout this course because it's beginner-friendly, hugely popular, and the commands you learn transfer to almost every other distribution. Here's how to get going on each path.

WSL on Windows (recommended for Windows users)

Open PowerShell as Administrator (right-click the Start menu → "Terminal (Admin)") and run a single command:

wsl --install

This enables the required Windows features and installs Ubuntu by default. Reboot when prompted. On first launch Ubuntu asks you to create a username and password — this is your Linux account, separate from your Windows login. After that you'll see something like:

Installing, this may take a few minutes...
Please create a default UNIX user account.
Enter new UNIX username: maya
New password:
Welcome to Ubuntu 24.04 LTS

maya@DESKTOP-7QK3:~$

That last line is your prompt. You're in. From now on, open the "Ubuntu" app (or type wsl in any terminal) to get back here.

A virtual machine with VirtualBox

If you'd rather have a self-contained Linux computer, the recipe is:

  1. Install VirtualBox from virtualbox.org.
  2. Download the Ubuntu Desktop ISO from ubuntu.com/download.
  3. In VirtualBox, click New, name it "Ubuntu", give it at least 2 CPUs, 4 GB RAM, and 25 GB disk, and point it at the ISO.
  4. Start the VM and follow the Ubuntu installer (choose "Install Ubuntu", set your timezone, create your user).
  5. When it reboots into the desktop, open the Terminal app (search "terminal" in Activities, or press Ctrl+Alt+T).
📌 VMs need breathing room

A VM borrows RAM and CPU from your real machine while it runs. If your laptop has only 8 GB of RAM, give the VM 4 GB at most and close heavy apps first, or it will feel sluggish. WSL doesn't have this problem because it shares resources dynamically.

A cloud instance over SSH

Cloud providers let you launch a Linux server in minutes. On AWS you'd create a free-tier EC2 instance with the Ubuntu image; the provider gives you a public IP address and a private key file. You then connect from any terminal with SSH (we cover SSH in depth in Section 15):

ssh -i my-key.pem [email protected]

The first time, SSH asks you to confirm the server's fingerprint — type yes. Then you're at a prompt on a machine that might be in a data center hundreds of miles away:

The authenticity of host '203.0.113.42' can't be established.
Are you sure you want to continue connecting (yes/no)? yes

ubuntu@ip-172-31-8-12:~$
💡 Expert Tip

You don't have to commit forever. Many learners start on WSL for speed, then later launch a free cloud instance just to practice SSH and "real server" workflows. The commands are identical everywhere — that portability is the whole point of learning Linux.

Terminal basics: reading the prompt

However you got here, you're now staring at a terminal — the text window — running a shell called Bash, which is the program that reads what you type and runs it. The little line waiting for your input is the prompt. It's not just decoration; it's a status line packed with information.

Anatomy of the Bash prompt A labelled breakdown of a typical shell prompt showing the username, the at sign, the hostname, the current directory, and the dollar sign that means you can type a command. Reading the prompt maya @ ubuntu : ~/projects $ user who you are host which machine current directory ~ means your home folder $ = your turn type a command here A # instead of $ means you are root — the all-powerful admin. Tread carefully.
The prompt maya@ubuntu:~/projects$ tells you who you are, where you are, and that the shell is ready for input.

Reading left to right: maya is your username, @ubuntu is the hostname (the machine's name), ~/projects is your current directory (where ~ is shorthand for your home folder), and the $ means "Bash is ready — type a command." If you ever see a # instead of $, you're acting as root, the superuser who can change anything on the system, so slow down and double-check what you type.

You run a command by typing it and pressing Enter. The shell does the work and prints any result below, then shows you a fresh prompt. A few comfort tips before your first commands:

  • Tab completion: start typing and press Tab to auto-complete file and command names. It saves typos and time.
  • History: press the arrow to recall previous commands so you don't retype them.
  • Stop a stuck command with Ctrl+C, and clear the screen with Ctrl+L or the clear command.
⚠️ Common Mistake

New users sometimes "explore" by running powerful commands they copied from the internet without understanding them. The most infamous footgun is:

# DO NOT run this — it tries to delete everything on the system
sudo rm -rf /

rm -rf means "remove, recursively and without asking", and combined with sudo (admin power) and / (the root of the whole filesystem) it can wipe your machine. Never paste a command you don't understand, especially one with sudo and rm in it. You'll learn exactly what each piece means in Section 3 — until then, type the simple commands below and you're perfectly safe.

Your first commands

Time to actually do something. These three commands are read-only — they just report information, so you can't break anything. Type each one and press Enter.

First, ask the system who you are:

$ whoami
maya

It prints your username. Simple, but it confirms the shell is listening and tells you which account you're operating as — genuinely useful when you hop between servers and accounts.

Next, ask for the current date and time:

$ date
Sun Jun 14 10:42:08 UTC 2026

Notice the timezone (here UTC). Servers are very often set to UTC, which matters when you're reading logs later in the course.

Finally, ask the system to describe itself:

$ uname -a
Linux ubuntu 6.8.0-31-generic #31-Ubuntu SMP x86_64 GNU/Linux

This one packs a lot in. uname means "Unix name", and the -a flag means "all info". It tells you the kernel name (Linux), the hostname (ubuntu), the kernel version, and the hardware architecture (x86_64). That word "flag" — a short option starting with - that changes how a command behaves — is a pattern you'll meet on nearly every command from here on.

Want to know more about any command before you run it? Two quick habits will carry you a long way (and we devote a whole lesson to them in Section 2):

# a quick built-in summary
$ date --help

# the full manual page (press q to quit)
$ man date
✅ Checkpoint

If whoami printed your username and uname -a printed a line starting with Linux, congratulations — you have a working Linux environment and you've run real commands. That's the hardest setup step in the entire course, and it's behind you.

Hands-on Exercise

Stand up an Ubuntu environment using whichever path fits your machine — WSL or a VM (or a cloud instance if you're feeling adventurous). Reach a Bash prompt, then run your first three commands and read each result:

  1. whoami — confirm which user you are.
  2. date — note the timezone it reports.
  3. uname -a — find your kernel version and architecture in the output.

Bonus: clear the screen with clear, then press the arrow to bring back a previous command without retyping it.

Show a worked solution

On Windows, in an Administrator PowerShell:

wsl --install
# reboot, create your UNIX user when prompted, then open the Ubuntu app

At the Ubuntu prompt, run the three commands:

maya@DESKTOP-7QK3:~$ whoami
maya
maya@DESKTOP-7QK3:~$ date
Sun Jun 14 10:42:08 UTC 2026
maya@DESKTOP-7QK3:~$ uname -a
Linux DESKTOP-7QK3 6.8.0-31-generic #31-Ubuntu SMP x86_64 GNU/Linux
maya@DESKTOP-7QK3:~$ clear

In the uname -a line, 6.8.0-31-generic is your kernel version and x86_64 is the CPU architecture. Pressing after clear brings back uname -a so you can rerun it with one keystroke.

Further reading

Lesson Summary
  • Three on-ramps to Linux — WSL, a VM, or a cloud instance — all land you at the same Bash prompt.
  • Windows users: wsl --install is the fastest path; macOS users: a VirtualBox Ubuntu VM.
  • The prompt encodes user@host:directory$; a # means you're root, so be careful.
  • Your first safe commands are whoami, date, and uname -a; never paste a sudo rm -rf command you don't understand.