The Terminal - A First Look for the Curious

Reading time: about 8 min

You have now mastered all the basic skills for using Ubuntu with the graphical interface. You can feel proud and confident, you can do all your daily work without ever going further than what you have already learned.

But... if you are a little curious about what is "under the hood"? You may have seen it in movies: a hacker typing cryptic commands on a black screen. That is the terminal. In reality it is not at all as dramatic or dangerous. See it as an alternative way to talk to your computer, not with clicks and icons, but with short, precise text commands. For certain tasks it is surprisingly much faster.

Important: Everything in this lesson is completely optional. You do not need to know the terminal to use Ubuntu, but it can be a fun and powerful tool to know about.


What You Will Learn

After this lesson you will:

  • Understand what the terminal is and why it is still so popular.
  • Dare to start the terminal and understand what is meant by a "prompt."
  • Be able to navigate your file system with three basic and completely harmless commands.
  • See a practical example of how the terminal can make a common task (updating) much faster.

The Basics: What is the Black Window?

The terminal is a program that gives you direct access to the operating system's core via a text-based interface. Instead of clicking on a folder to open it, you write a command that says "go into this folder."

1. Start the Terminal

  • Press the Super key.
  • Type Terminal and press Enter.
  • A window with a blinking cursor appears. Congratulations, you are in!

2. Understanding the Prompt The text displayed before the cursor is called the prompt. It gives you important information and usually looks something like this: yourname@computername:~$

  • yourname: Your username.
  • computername: The name of your computer.
  • ~: This is a very important symbol! Tilde (~) is a shorthand for your Home directory. The prompt is thus telling you that you are currently "located" in your Home directory.
  • $: This symbol indicates you are logged in as a regular user.

Practical Examples: Three Harmless Commands to Test

We will now test three commands that only show information, they cannot change or destroy anything. Type the command and press Enter to run it.

1. pwd - "Where am I?"

The command pwd stands for "Print Working Directory."

  • Type: pwd
  • Result: The terminal writes out the full path to the folder you are in, e.g. /home/yourname. This is your GPS command.

2. ls - "What is here?"

The command ls stands for "List." It shows the contents of the folder you are in.

  • Type: ls
  • Result: You will see a list of all folders and files in your Home directory, like Documents, Pictures, Downloads etc. It is exactly the same content you see if you open Files.

3. cd - "Go there!"

The command cd stands for "Change Directory."

  • Type: cd Documents
  • Result: You have now "entered" your Documents folder. Look at the prompt, it has probably changed to yourname@computername:~/Documents$. The tilde symbol plus "Documents" shows your new location.
  • Test again: Type ls now and you see the contents of the Documents folder.
  • Go back: Type cd .. (.. means "one folder up") to go back to your Home directory.

A Powerful Command: Update Your System

Remember the Software Updater tool from the previous lesson? You can do exactly the same thing with a single command in the terminal. Many experienced users prefer this way because it is so fast.

  • Type: sudo apt update && sudo apt upgrade -y
  • What happens?
    • sudo apt update: Asks the system to fetch the latest list of available updates. sudo means "do this as administrator," so you will need to enter your password.
    • &&: Means "if the first succeeded, then run the next command."
    • sudo apt upgrade -y: Installs all updates that were found and automatically answers "yes" (-y) to all questions.

You do not need to memorize this, but see it as an example of the terminal's efficiency.


Exercise: Explore Your File System

Test now the basic navigation loop on your own.

  1. Open the Terminal.
  2. Type pwd to see where you are.
  3. Type ls to see the contents.
  4. Navigate to your Pictures folder with the command cd Pictures.
  5. Check that you are in the right place with pwd.
  6. List the contents of the Pictures folder with ls.
  7. Go directly back to your Home directory with the command cd (without anything after).

Next Steps

Nice job! You have now dared to take the step into the terminal and seen that it is not so dangerous, but rather a powerful complement. Now we leave the command line for this time and return to the graphical interface.

In the next lesson, Customize Ubuntu to Your Preferences, we focus on the fun: how you can change the appearance and feel of your desktop to make it truly personal.