You do not need to use the command line to use Linux for everyday tasks — but knowing a handful of basic commands makes Linux much easier to manage and troubleshoot. This guide covers the most useful Linux commands for beginners, with practical examples for each one.
Opening the Terminal
The terminal is the Linux command line. To open it:
- Ubuntu: Press Ctrl+Alt+T, or search for “Terminal” in the app launcher
- Linux Mint: Press Ctrl+Alt+T, or right-click the desktop and select “Open Terminal”
A black (or dark) window will appear with a prompt ending in $. This is where you type commands.
A word you will see often: sudo. This stands for “superuser do” and grants administrator-level permissions for a command. Linux will ask for your password when you use it.
Navigation Commands
pwd — Print Working Directory
Shows you which folder (directory) you are currently in.
pwd
Example output: /home/username
ls — List Files
Lists the files and folders in your current directory.
ls
Add -l for a detailed list with file sizes and permissions, or -a to show hidden files (files starting with a dot):
ls -la
cd — Change Directory
Moves you into a different folder.
cd Documents
cd /home/username/Downloads
Use cd .. to go up one level (to the parent folder). Use cd ~ to go back to your home directory.
File and Folder Commands
mkdir — Make Directory
Creates a new folder.
mkdir my-folder
cp — Copy
Copies a file from one location to another.
cp file.txt /home/username/backup/file.txt
To copy a whole folder and its contents, add the -r flag:
cp -r my-folder /home/username/backup/
mv — Move (or Rename)
Moves a file to a new location, or renames it.
mv old-name.txt new-name.txt
mv file.txt /home/username/Documents/
rm — Remove
Deletes a file. Warning: There is no Recycle Bin — deleted files are gone immediately.
rm file.txt
To delete a folder and all its contents:
rm -r folder-name
cat — Display File Contents
Prints the contents of a text file to the terminal.
cat filename.txt
Package Management (Installing Software)
On Ubuntu and Linux Mint, software is installed using the apt command.
Update package list
Always run this before installing software to get the latest list of available packages:
sudo apt update
Install software
sudo apt install vlc
sudo apt install gimp
Update all installed software
sudo apt update && sudo apt upgrade
Remove software
sudo apt remove vlc
System Information Commands
df — Disk Free Space
Shows how much disk space is used and available on each drive.
df -h
The -h flag shows sizes in human-readable format (GB, MB).
free — RAM Usage
Shows how much RAM is being used.
free -h
top — Process Monitor
Shows running processes and their CPU/RAM usage in real time (like Task Manager in Windows). Press q to quit.
top
uname — System Information
Shows information about the operating system and kernel version.
uname -a
Network Commands
ping
Tests network connectivity to a host.
ping google.com
Press Ctrl+C to stop.
ip a — Show IP Address
Shows your network interfaces and their IP addresses.
ip a
Permissions Commands
chmod — Change File Permissions
Changes the read/write/execute permissions of a file.
chmod +x script.sh
The +x flag makes a file executable (runnable as a program).
chown — Change Owner
Changes who owns a file.
sudo chown username:username file.txt
Getting Help
If you want to know more about any command, type man followed by the command name to read the manual page:
man ls
Press q to exit. Many commands also accept a --help flag for a quick summary:
ls --help