Terminal start Lesson 1 of 12
What is a terminal? Reading the prompt
7 minutes
Learning goals
- Tell the terminal, the shell and the prompt apart.
- Read who you are, which computer you are on and where you are from the prompt.
- Run your first commands whoami, hostname and date.
- Stay calm when the terminal answers "command not found".
Terminal, shell, prompt
Three words you will hear all the time:
- The terminal is the window. It shows text and passes on what you type.
- The shell is the program inside that window that reads your line and runs it. On most Linux systems it is called bash.
- The prompt is the short text in front of the cursor. The shell writes it whenever it waits for you.
Here, the prompt looks like lerner@terminal:~$. Read it from left to right:
lerneris the user you are working as.@terminalmeans "on the computer called terminal".:~is where you are right now. The tilde~stands for your home folder, the place where your own files live.$closes the prompt. It means: ready, type something. A#in this place would mean you are working as the administrator, which you are not.
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
lernerhostname 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
terminaldate 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 2026Notice 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.
Task complete
Solution
whoami Why: Before you change anything on a computer, it helps to know as whom you are doing it. whoami answers that in one word.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Repeat: you have solved this task before.
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
hostnameBefore the command, in your home folder ~
- ~/.bashrc
- ~/.profile
- ~/.config/
- ~/Documents/
- ~/Downloads/
- ~/Pictures/
- ~/notes.txt
- ~/projects/
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
- the current folder (~)
- the user name (lerner)
- the computer name (terminal)
- the sign that the shell is ready ($)
Next up: finding out where you are and looking around with pwd, ls and cd.
Quiz
-
Check works once you have chosen an answer.
-
Check works once you have chosen an answer.
-
Check works once you have chosen an answer.
-
Check works when exactly 2 are chosen. Chosen: 0.
Cards
-
Card 1 of 4
Tap the card or press Space to turn it over.
-
Card 2 of 4
Tap the card or press Space to turn it over.
-
Card 3 of 4
Tap the card or press Space to turn it over.
-
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
What you can do now: whoami, hostname, date
+0 XP in this lesson
- Lesson 1: done
- Lesson 2: open
- Lesson 3: open
- Lesson 4: open
- Lesson 5: open
- Lesson 6: open
- Lesson 7: open
- Lesson 8: open
- Lesson 9: open
- Lesson 10: open
- Lesson 11: open
- Lesson 12: open
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
-
whoamishow your user name -
hostnameshow the name of the computer -
dateshow date and time