Terminal Basics
Challenge Gallery
Quick Reference
| Command | What It Does |
|---|---|
whoami |
Print your username |
hostname |
Print the machine’s name |
date |
Print current date and time |
cal |
Print a calendar for the current month |
uname -a |
Print system info (kernel, architecture, etc.) |
clear |
Clear the terminal screen (or Ctrl+L) |
Command Structure
command [options] [arguments]
| Part | Example | Role |
|---|---|---|
| Command | ls |
The program to run |
| Options | -la |
Modify behavior (start with -) |
| Arguments | /home |
What it acts on |
The Prompt
student@ubuntu:~$
│ │ │└─ $ = regular user (# = root)
│ │ └── ~ = current directory (home)
│ └────────── hostname
└────────────────── username
How It Works
student@ubuntu:~$ whoami
student
student@ubuntu:~$ hostname
ubuntu
student@ubuntu:~$ date
Mon Mar 30 09:15:42 PDT 2026
student@ubuntu:~$ uname -a
Linux ubuntu 6.8.0-31-generic #31-Ubuntu SMP x86_64 GNU/Linux
student@ubuntu:~$ cal
March 2026
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
student
student@ubuntu:~$ hostname
ubuntu
student@ubuntu:~$ date
Mon Mar 30 09:15:42 PDT 2026
student@ubuntu:~$ uname -a
Linux ubuntu 6.8.0-31-generic #31-Ubuntu SMP x86_64 GNU/Linux
student@ubuntu:~$ cal
March 2026
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
The shell is a REPL: Read your command, Evaluate (execute) it, Print the result, Loop back for the next one. The default shell on Linux is bash (Bourne Again Shell).
Common Pitfalls
- Case sensitivity –
CALis notcal. Unix commands are lowercase. - Typos get no mercy – the shell won’t guess what you meant.
datis notdate. $vs#– if your prompt shows#, you’re root. Tread carefully.- Spaces matter –
ls-lais notls -la. The space separates the command from its options.