Essential Linux Terminal Commands

The terminal is your Linux superpower — here are the commands every beginner should learn first

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

# See where you are right now
$ 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

# Create a new empty file
$ 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

# Display the entire file
$ 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

# Update your package list (Ubuntu/Mint/Debian)
$ 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 a file by name
$ 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

CommandWhat It DoesExample
pwdPrint current locationpwd
lsList filesls -la
cdChange directorycd Documents
cpCopy filecp a.txt b.txt
mvMove or renamemv old.txt new.txt
rmDelete filerm file.txt
mkdirCreate foldermkdir photos
catView file contentscat notes.txt
sudoRun as administratorsudo apt update
clearClear terminal screenclear

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 --help after any command (e.g., ls --help) to see all its options.
  • The man pages: Type man ls to 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.

Next Step: Install Software

Now that you know the terminal basics, learn how to install all your favorite apps on Linux.

Installing Software on Linux →