Linux module
Lesson 2
Meet the terminal
Prompts, commands, flags, help, and how to stop a running command.
beginner25 minRun on your machine
What you will be able to do
- Describe the difference between a terminal, a shell, and the operating system
- Run a command with a flag and an argument
- Stop a command with Ctrl+C and re-run a previous command from history
Why this matters for DE and AI
When a training job hangs or a pipeline stops printing logs, the first move is not a dashboard. It is a terminal: run a command, read the output, cancel if it is wrong. This lesson is the grammar of that conversation.
Concepts
Operating system — Windows, macOS, or Linux. It owns the hardware.
Terminal — the window you type in. It does not think. It displays text and sends your keystrokes onward.
Shell — the program that interprets what you type. Common shells: bash (typical on Ubuntu/WSL) and zsh (typical on macOS). Commands in this module work in both.
You talk to the shell. The shell talks to the OS.
Anatomy of a command
command --flag argument
ls -la /tmp
- Command — the program (
ls,echo,date). - Flag (also called an option) — changes behavior. Flags often start with
-or--. - Argument — the thing to act on, often a file or folder.
Spaces matter. ls-la is not ls -la.
Getting help
Most commands accept --help:
ls --help
The output is long. You do not need to memorize it. Skim the first screen.
man ls opens a manual page. Press q to quit. Beginners often find --help less intimidating. Use whichever you can leave.
Keyboard habits
| Keys | What it does |
|---|---|
| Enter | Run the line |
| Ctrl + C | Stop the running command |
| ↑ | Previous command |
Ctrl + L or clear |
Clear the screen |
| Tab | Complete a name (next lesson uses this a lot) |
Practice on your machine
Open your terminal and go to the lab folder:
cd ~/dcubes/linux-lab
Print a line of text:
echo hello from dcubes
What you should see: hello from dcubes
Print today’s date:
date
What you should see: a date and time in your timezone.
Ask who the shell thinks you are:
whoami
Ask echo for its help text:
echo --help
You should see a usage summary. (On some shells echo is built-in; help still works.)
Now start a command that keeps running until you stop it:
sleep 60
Nothing will print. The prompt is gone. The machine is sleeping for 60 seconds. Do not wait. Press Ctrl + C. The prompt should return, sometimes with ^C.
Press ↑ until you see echo hello from dcubes and press Enter again.
Run history | tail if your shell supports history. You should see the commands you just typed.
Common mistakes
- Typing the prompt. Do not type
sam@laptop:$. Type only the command. - Using a word processor. Notepad or Word will wrap quotes and break commands. Use the terminal, or a plain editor later.
- Panic when there is no output. Many commands succeed silently.
sleepis one.mkdiris another, next lessons.
Next
The filesystem is your data lake — paths, cd, and ls.