The terminal (also called the command line or shell) is a text-based way to control your computer. While you can do almost everything with the graphical interface, the terminal lets you do it faster — and sometimes it's the only way to do certain advanced tasks.
Don't panic! You don't need to memorize all of these at once. Bookmark this page and come back whenever you need a reference. Start with the first five and build from there.
Opening the Terminal
Press Ctrl + Alt + T on your keyboard. That's it — a terminal window will appear. You can also find it in your application menu by searching for "Terminal."
Navigating Files and Folders
$ pwd
# List files in the current folder
$ ls
# List files with details (size, date, permissions)
$ ls -la
# Move into a folder
$ cd Documents
# Go back to the parent folder
$ cd ..
# Go straight to your home folder
$ cd ~
Working With Files
$ touch myfile.txt
# Create a new folder
$ mkdir my-folder
# Copy a file
$ cp myfile.txt backup.txt
# Move (or rename) a file
$ mv myfile.txt Documents/myfile.txt
# Delete a file (be careful — no recycle bin!)
$ rm myfile.txt
# Delete a folder and its contents
$ rm -r my-folder
The rm command deletes files permanently — there's no recycle bin in the terminal. Always double-check before pressing Enter. When in doubt, use the file manager instead.
Viewing File Contents
$ cat myfile.txt
# View a long file page by page
$ less myfile.txt
# Show just the first 10 lines
$ head myfile.txt
# Show just the last 10 lines
$ tail myfile.txt
System Commands
$ sudo apt update
# Upgrade all installed packages
$ sudo apt upgrade
# Install a program (e.g., VLC)
$ sudo apt install vlc
# Remove a program
$ sudo apt remove vlc
# Check disk space usage
$ df -h
# See running processes
$ top
Searching and Finding
$ find /home -name "myfile.txt"
# Search for text inside files
$ grep "hello" myfile.txt
# Search for text in all files in a folder
$ grep -r "hello" Documents/
Quick Reference Table
| Command | What It Does | Example |
|---|---|---|
pwd | Print current location | pwd |
ls | List files | ls -la |
cd | Change directory | cd Documents |
cp | Copy file | cp a.txt b.txt |
mv | Move or rename | mv old.txt new.txt |
rm | Delete file | rm file.txt |
mkdir | Create folder | mkdir photos |
cat | View file contents | cat notes.txt |
sudo | Run as administrator | sudo apt update |
clear | Clear terminal screen | clear |
Tips for Terminal Success
- Tab completion: Start typing a file or folder name and press Tab — the terminal will auto-complete it for you.
- Command history: Press the Up arrow to cycle through your previous commands.
- Cancel a command: Press Ctrl + C to stop a running command.
- Get help: Add
--helpafter any command (e.g.,ls --help) to see all its options. - The man pages: Type
man lsto read the full manual for any command.
Understanding sudo: Some commands need administrator privileges. Prefix them with sudo and enter your password. Only use sudo when necessary — it gives full system access.