terminal.cab

Terminal start Lesson 1 of 12

guestLevel 1Badges and progress0/100 XP, XP to the next levelStreak0

What is a terminal? Reading the prompt

7 minutes

Learning goals

Terminal, shell, prompt

Three words you will hear all the time:

Here, the prompt looks like lerner@terminal:~$. Read it from left to right:

Your first commands

A command is a word you type after the prompt, followed by Enter. whoami answers the question "who am I?":

whoami

Purpose: Prints the name of the user you are working as.

Syntax: whoami

Example:

whoami
lerner

in the glossary: whoami

hostname tells you the name of the computer. That matters later, when you work on several machines and want to know which one you are typing on.

hostname

Purpose: Prints the name of the computer you are working on.

Syntax: hostname

Example:

hostname
terminal

in the glossary: hostname

date shows the date and time of the computer. The time zone sits between the time and the year, here UTC.

date

Purpose: Prints the current date and time of the computer.

Syntax: date

Example:

date
Sat Oct 17 09:00:00 UTC 2026

in the glossary: date

Notice that each answer matches a part of the prompt: whoami prints the part before the @, hostname the part after it.

When the shell does not know a word

Type something the shell does not know, for example whoamii with one letter too many, and you get: bash: whoamii: command not found. That is all. Nothing broke, nothing changed. The shell just tells you it has no command with that name. Check the spelling and try again. The message always names the word it did not understand, which makes typos easy to spot.

Practice

Try it yourself. The terminal below starts in your home folder.

Terminal task

Ask the computer which user you are working as.

Task 1/1: Ask the computer which user you are working as.

Ask the computer which user you are working as.

Loading terminal …

lerner@terminal: ~bash
lerner@terminal:~$

Esc, then Tab leaves the terminal

Not done yet

Fill the gap

In the prompt lerner@terminal:~$ the name of the computer is .

In the prompt lerner@terminal:~$ the name of the computer is ….

Check works once you have typed an answer.

Predict the output

Command

hostname

Before the command, in your home folder ~

  • ~/.bashrc
  • ~/.profile
  • ~/.config/
  • ~/Documents/
  • ~/Downloads/
  • ~/Pictures/
  • ~/notes.txt
  • ~/projects/
What does hostname print?

Check works once you have chosen an answer.

Put in order

Put the parts of the prompt lerner@terminal:~$ in order, from left to right.

Steps

  1. the current folder (~)
  2. the user name (lerner)
  3. the computer name (terminal)
  4. the sign that the shell is ready ($)

Next up: finding out where you are and looking around with pwd, ls and cd.

Quiz

  1. Question 1 of 4What does the $ at the end of the prompt tell you?

    Check works once you have chosen an answer.

  2. Question 2 of 4You type whoamii and get "bash: whoamii: command not found". What happened?

    Check works once you have chosen an answer.

  3. Question 3 of 4What does ~ stand for in the prompt lerner@terminal:~$?

    Check works once you have chosen an answer.

  4. Question 4 of 4Which statements are true? Choose TWO.

    Check works when exactly 2 are chosen. Chosen: 0.

Cards

  1. Card 1 of 4

    Tap the card or press Space to turn it over.

  2. Card 2 of 4

    Tap the card or press Space to turn it over.

  3. Card 3 of 4

    Tap the card or press Space to turn it over.

  4. Card 4 of 4

    Tap the card or press Space to turn it over.

End of the lesson

Still open: 4 exercises, 4 quiz questions

Next: lesson 2, Where am I? pwd, ls and cd (9 min)

What you can do now: whoami, hostname, date

+0 XP in this lesson

  1. Lesson 1: done
  2. Lesson 2: open
  3. Lesson 3: open
  4. Lesson 4: open
  5. Lesson 5: open
  6. Lesson 6: open
  7. Lesson 7: open
  8. Lesson 8: open
  9. Lesson 9: open
  10. Lesson 10: open
  11. Lesson 11: open
  12. Lesson 12: open
1 of 12

Next: lesson 2, Where am I? pwd, ls and cd (9 min) That's enough for today

Path complete

You finished all 12 lessons of Terminal start.

On to Linux Basics: lesson 1, Finding your way around a strange server (8 min) Back to the path

Cheat sheet