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.
pwdExample output: /home/username
ls — List Files
Lists the files and folders in your current directory.
lsAdd -l for a detailed list with file sizes and permissions, or -a to show hidden files (files starting with a dot):
ls -lacd — Change Directory
Moves you into a different folder.
cd Documentscd /home/username/DownloadsUse 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-foldercp — Copy
Copies a file from one location to another.
cp file.txt /home/username/backup/file.txtTo 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.txtmv file.txt /home/username/Documents/rm — Remove
Deletes a file. Warning: There is no Recycle Bin — deleted files are gone immediately.
rm file.txtTo delete a folder and all its contents:
rm -r folder-namecat — Display File Contents
Prints the contents of a text file to the terminal.
cat filename.txtPackage 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 updateInstall software
sudo apt install vlcsudo apt install gimpUpdate all installed software
sudo apt update && sudo apt upgradeRemove software
sudo apt remove vlcSystem Information Commands
df — Disk Free Space
Shows how much disk space is used and available on each drive.
df -hThe -h flag shows sizes in human-readable format (GB, MB).
free — RAM Usage
Shows how much RAM is being used.
free -htop — Process Monitor
Shows running processes and their CPU/RAM usage in real time (like Task Manager in Windows). Press q to quit.
topuname — System Information
Shows information about the operating system and kernel version.
uname -aNetwork Commands
ping
Tests network connectivity to a host.
ping google.comPress Ctrl+C to stop.
ip a — Show IP Address
Shows your network interfaces and their IP addresses.
ip aPermissions Commands
chmod — Change File Permissions
Changes the read/write/execute permissions of a file.
chmod +x script.shThe +x flag makes a file executable (runnable as a program).
chown — Change Owner
Changes who owns a file.
sudo chown username:username file.txtGetting Help
If you want to know more about any command, type man followed by the command name to read the manual page:
man lsPress q to exit. Many commands also accept a --help flag for a quick summary:
ls --helpRelated Guides
- What is Linux? A Plain-English Guide
- How to Install Ubuntu on Your PC
- Best Linux Distros for Beginners