Module 1 · First steps in the terminal
Reading the prompt and typing your first commands
What the prompt is telling you, how a command line is built from a name, options and arguments, and six commands you can use right now.
What you will learn
- Decode the prompt of the practice machine and of a typical Linux.
- Name the parts of a command line: command, options, arguments.
- Run `date`, `whoami`, `uname`, `echo`, `ls` and `touch`.
The prompt is the shell's way of saying two things: "I am ready" and "here is where you are". On the practice machine it is short: ~%. On most Linux systems it is longer, something like ana@laptop:~$. Both carry the same information, just more or less of it.
Decoding the prompt
| Piece | Meaning | Example |
|---|---|---|
~ | Your home directory. On this machine, /root. | ~% |
| A name | The directory you are in, last component only. | tmp% while in /tmp |
$ or % | An ordinary user is at the keyboard. | ana@laptop:~$ |
# | Root is at the keyboard. Think twice before Enter. | root@server:/etc# |
The practice machine keeps its prompt minimal: the current directory's name and a %. It does not show the usual # even though you are root, so do not rely on the symbol here; whoami is the honest answer. Watch the prompt change as you move: in lesson 5 you will see ~% become tmp% and then etc%.
Anatomy of a command line
A line is split on spaces into words. The first word is the command: a program to run, or a word the shell understands itself. The remaining words are passed to it. By convention, words starting with - are options (also called flags or switches) that change *how* the command behaves, and the rest are arguments, usually *what* it should act on. In ls -l /tmp, ls is the command, -l an option and /tmp an argument. Spaces matter: ls-l is one unknown word.
~% date
Sun Oct 4 18:52:18 UTC 2026
~% uname -a
Linux (none) 4.16.13 #13 SMP Sat Jul 21 13:56:18 CST 2018 i686 GNU/Linux
~% ls
~% touch hello.txt
~% ls
hello.txt
~% echo done
done
Six commands, read top to bottom. date prints the clock. uname -a prints everything uname knows: kernel, hostname (here the odd-looking (none)), version, build date and the i686 architecture. ls lists the current directory — empty at first, so it prints nothing and the prompt simply returns. touch hello.txt creates an empty file, and the second ls proves it. Silence is normal: most commands say nothing when they succeed.
When something goes wrong
Errors are short and specific. not found means the command name is wrong or the program is not installed. No such file or directory means an argument names something that does not exist — look for a typo in the path. invalid option means the dash-word is not one the command knows; lesson 7 shows how to look options up. Read the message, fix the one thing it names, and press Enter again. Nothing is damaged by a failed command.
Commands in this lesson
| Command | What it does |
|---|---|
date | Print the current date and time. |
whoami | Print your user name. |
uname -a | Kernel name, hostname, version and architecture in one line. |
echo TEXT | Print TEXT. |
ls | List the files in the current directory. |
touch FILE | Create FILE, empty, if it does not exist. |
Quiz
In `ls -l /tmp`, which word is the option?
- `ls`
- `-l`
- `/tmp`
A prompt ends in `#`. What does that usually tell you?
- The shell is waiting for a comment
- You are root
- The previous command failed
You run `touch notes.txt` and nothing is printed. What happened?
- It failed silently
- It worked; most commands are silent on success
- It is still running
What does `~` in the prompt stand for?
- The root of the filesystem
- Your home directory
- A temporary directory
Which of these is the same command as `ls`?
- `LS`
- `Ls`
- None of them; names are case-sensitive
Practice
In /root/lab/l2, create an empty file called `hello.txt`.
Print the current date and time.
Print the full system identification line: kernel, version and architecture together.
Open this lesson in the app to do the tasks in a real Linux machine and have them checked.