Linux Basics · Lesson 2 · 10 min

Meet the terminal

In movies, hackers type green text into a black window. That window is the terminal, and it's less scary than it looks. You type a command, press Enter, and the computer answers.

You will learn

  • What the terminal and the shell are, and why people still use them
  • How to read the prompt, and how it looks different on Rocky and Ubuntu
  • The parts of a command: the command itself, its options and its arguments
  • Keyboard tricks the pros use

Why type when you can click?

The terminal is the window. The program inside it that reads your commands is called the shell. On both Rocky and Ubuntu, the shell is bash.

Reading the prompt

The text the computer shows before your cursor is called the prompt. It's the computer saying “I'm ready, what next?” It also tells you who and where you are. The two families draw it slightly differently:

Rocky / RHEL
[studentuser@rockycomputer~folder]$normal user

Rocky shows only the name of the current folder, and the prompt has no colors.

Ubuntu / Debian
studentuser@ubuntucomputer:~folder$normal user

Ubuntu shows the full path of the current folder, in green and blue.

The parts of a command

Commands are like short sentences, and they have a grammar:

lscommand (verb)-loption (how)/homeargument (what)

Five golden rules

  1. Upper and lower case are different. ls works, LS doesn't. Documents and documents are two different names.
  2. Spaces matter. cd .. works, cd.. doesn't.
  3. No news is good news. Many commands print nothing when they work. If you get the prompt back with no error, it worked.
  4. Errors are clues, not punishments. Read them. They usually tell you exactly what's wrong.
  5. Commands are the same on both families. Everything in this lesson works the same on Rocky and Ubuntu. Only the prompt looks different.

Pro keyboard moves

KeyWhat it does
↑ / ↓Scroll through the commands you already typed. No need to retype them.
TabAuto-complete a command or file name. Type cd Doc and press Tab. Use it constantly.
Ctrl+CCancel or stop what's running. Your emergency exit. (It does not copy in a terminal!)
Ctrl+L or clearClear the screen.

Where do I get a real terminal?

Try it

Click in the terminal and complete the missions. You can type help at any time.

Quick check

1. The prompt ends in # instead of $. What does that mean?

2. In ls -a /tmp, which part is the option?

3. You type a command, press Enter, and nothing is printed. Just a new prompt. What happened?

Finished the missions and the quiz? Mark it done to track your progress.