Setup: The Terminal on Linux
Open a terminal on Ubuntu, check that it runs bash 5, install bats with apt, and make the practice folder every lesson in this course uses.
Novice · Unix · Linux · Updated
After this lesson you can
- Open a terminal on Ubuntu and check its shell with echo $SHELL and bash --version
- Choose the apt commands that install a tool on Ubuntu, and check it with --version
Key takeaways
- On Ubuntu, Ctrl+Alt+T opens a terminal. It's also in the app list, as Terminal.
- echo $SHELL names your shell, and bash --version gives its version. Ubuntu's is bash 5, so there's nothing to upgrade.
- apt is Ubuntu's package manager. sudo apt update refreshes its list, and sudo apt install bats installs the exercise checker.
- sudo runs one command as the administrator. It asks for your password, and nothing shows on the screen while you type it.
If your computer runs Ubuntu, you're using the same kind of system as most of the servers that run the internet, and its terminal is the same one you'd use on them. bash comes with it. This lesson opens the terminal, checks what you have, and adds the one tool the course needs, in about ten minutes. (On a Mac or Windows? Setup: The Terminal on a Mac or Setup: The Terminal on Windows is your lesson instead.)
Open a terminal
Press Ctrl+Alt+T, and a terminal opens. You can also click Show Apps (the grid of dots at the bottom of the dock), type Terminal, and press Enter. You'll use it often, so right-click its icon in the dock and choose Pin to Dash.
The line in the window, something like sam@laptop:~$, is the prompt: the shell saying "ready: type a command". Shell, Terminal, Prompt takes it apart.
On another Linux, such as Fedora or Linux Mint, the terminal is in the app menu too. Everything in this course works the same, except installing software: Fedora uses dnf where Ubuntu uses apt.
Check your shell
The program that reads what you type is called a shell. Ask which one yours is:
echo $SHELL
/bin/bash
$SHELL is read "the value of SHELL": the shell your account opens. Now its version:
bash --version
GNU bash, version 5.3.9(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Only the first line matters: version 5.3.9. That's Ubuntu 26.04; Ubuntu 24.04 says 5.2, and everything in this course works the same on both.
Install bats with apt
The exercises in this course are checked by bats, a small program that runs checks written for bash. Ubuntu installs programs with apt, its package manager: a catalog of thousands of free programs, each installed by its name.
Installing software changes the whole computer, not only your own files, so it needs the administrator's permission. That's what sudo (read "sue-doo", for "superuser do") gives one command at a time. It asks for your password, the one you sign in with. Nothing shows on the screen while you type it; type it anyway and press Enter.
sudo apt update
sudo apt install bats
apt update refreshes apt's catalog, so it knows the newest versions, and apt install bats downloads and installs bats. If apt asks whether to continue, press Y, then Enter. Then check it worked:
bats --version
It prints Bats and a version number, such as Bats 1.13.0 on Ubuntu 26.04. If it says command not found, run the install line again and read its last lines for an error.
Make your practice folder
Every lesson works in one practice folder, terminal-practice, in your home folder, so nothing you try touches your real files. Make it, go into it, and ask where you are:
mkdir -p ~/terminal-practice
cd ~/terminal-practice
pwd
/home/sam/terminal-practice
You'll see your own user name instead of sam. mkdir makes a folder (Module 2 covers it), cd moves you into it, and pwd says where you are (both are in the next chapter). Now type xdg-open . and the Files app opens the same folder: two doors into one place.
Check yourself
2 questions to try on the lesson page.
So what
Your Ubuntu terminal now has everything this course uses: bash 5 for commands and scripts, apt for installing tools, bats for exercise checks and a practice folder to try things in.