Cybersecurity Foundations (Grades 6–8) · lesson 18 of 48 · 15 min
The Linux Terminal — Your Most Powerful Tool
The terminal (also called the command line, shell, or CLI — Command Line Interface) is a text-based interface for interacting with Linux. Instead of clicking icons and menus, you type commands. The terminal responds with text output.
This might seem less intuitive than a graphical interface — and at first, it is. But the terminal is far more powerful. You can automate repetitive tasks with scripts, manage remote servers without a graphical interface, run complex operations with a single command, and access tools that have no graphical equivalent. Every professional cybersecurity tool is designed to be used from the terminal.
By the end of this lesson you will be able to navigate the Linux file system using terminal commands, create, move, copy, and delete files, view file contents, and understand the anatomy of a Linux command.
The shell
The terminal runs a program called a shell — software that interprets your commands and passes them to the kernel. The most common shell is Bash (Bourne Again Shell). When you open a terminal on Ubuntu or Kali Linux, you are using Bash. Other shells include Zsh (used by macOS by default), Fish, and sh. For this lesson, all commands work in Bash.
Anatomy of a Linux Command
Every Linux command follows the same basic structure:
command -options argument
command
The program to run (e.g. ls, cd, cat)
-options
Flags that modify behaviour (e.g. -l, -a, –help)
argument
What to act on (e.g. a filename or directory)
Example: ls -la /home/user
Essential Commands — Navigation
These are the commands you will use every time you open a terminal. Master these first.
bash — navigation commands
pwd — print working directory (where am I?)
$ pwd
/home/student
ls — list directory contents
$ ls
Documents Downloads Desktop Pictures
$ ls -la
total 32
drwxr-xr-x 5 student student 4096 Sep 27 Documents
-rw-r–r– 1 student student 512 Sep 27 notes.txt
cd — change directory
$ cd Documents
$ cd .. # go up one level
$ cd ~ # go to home directory
$ cd / # go to root directory
- pwd
- Print Working Directory — shows your current location
- ls
- List — shows files and folders in current directory
- ls -la
- List with details and hidden files (-l = long, -a = all)
- cd [dir]
- Change Directory — move to a different folder
cd ..
- Go up one directory level
- cd ~
- Go to your home directory
Essential Commands — Files and Directories
bash — file operations
mkdir — make a new directory
$ mkdir projects
touch — create an empty file
$ touch notes.txt
cat — display file contents
$ cat notes.txt
Hello, this is my notes file.
cp — copy a file
$ cp notes.txt backup.txt
mv — move or rename a file
$ mv notes.txt Documents/notes.txt
rm — remove (delete) a file
$ rm backup.txt
WARNING: rm -rf deletes everything recursively — use with extreme caution
rm is permanent
Unlike the Windows Recycle Bin or macOS Trash, rm in Linux permanently deletes files immediately. There is no undo. The command rm -rf / would delete your entire operating system. Always double-check before using rm.
Activity — Match the Command
Linux Command Matcher
Practice the Terminal
Use the interactive terminal below to practice the commands from this lesson. Try: ls, pwd, cd, cat, and mkdir.
Tech Camp for Kids Learning Terminal
Task
- Hide hint
- Show hint
Task complete! Reset terminal
Knowledge Check — The Linux Terminal
What does the command “pwd” do?
- Creates a new directory
- Shows your current directory path
- Lists files in a directory
- Deletes a file
Answer: Shows your current directory path
pwd = Print Working Directory. It shows the full path of the directory you are currently in.
What does “ls -la” show that “ls” alone does not?
- Nothing different — they are the same
- Detailed file information AND hidden files (files starting with .)
- Only hidden files
- Only files, not directories
Answer: Detailed file information AND hidden files (files starting with .)
-l shows long format (permissions, size, date), -a shows all files including hidden ones (starting with .). Combined, ls -la shows everything.
You want to go up one directory level. Which command do you use?
- cd up
- cd ..
- cd back
- cd /
Answer: cd ..
cd .. moves you up one level in the directory tree. cd / takes you to the root directory. cd ~ takes you to your home directory.
Why should you be very careful with the “rm” command?
- It is slow and takes a long time
- It permanently deletes files with no undo or recycle bin
- It only works on empty directories
- It requires administrator permission for all files
Answer: It permanently deletes files with no undo or recycle bin
Unlike Windows or macOS, Linux’s rm command permanently deletes files immediately. There is no recycle bin and no undo.
Previous lesson: What is Linux?
Back to Cybersecurity Foundations (Grades 6–8)
Next lesson: Files, users, and permissions