If you’re new to Ubuntu or just starting to explore the terminal, you’re in the right place. The Linux command line is a powerful tool that lets you control your system efficiently. In this guide, we’ll walk you through the most important Ubuntu terminal commands—organized by category—for beginners and intermediate users.
Whether you want to manage files, install software, or monitor system performance, this article has you covered.
Why Use Terminal in Ubuntu?
- More control over the system
- Faster operations for repetitive tasks
- Access to advanced features
- Remote server management
1. Basic File and Directory Commands
Command | Description |
---|---|
ls |
List files and directories |
cd [directory] |
Change directory |
pwd |
Show current directory |
mkdir [name] |
Create a new directory |
rm [file] |
Delete a file |
rm -r [folder] |
Delete a folder recursively |
cp [src] [dest] |
Copy file or folder |
mv [src] [dest] |
Move or rename file/folder |
touch [file] |
Create an empty file |
nano [file] |
Edit file using Nano editor |
clear |
Clear the terminal |
2. System Information Commands
Command | Description |
---|---|
uname -a |
Display system info |
top |
Live view of processes |
htop |
Interactive process viewer |
df -h |
Disk usage |
free -h |
Memory usage |
uptime |
System uptime |
whoami |
Current user |
hostname |
Hostname of the system |
3. APT Package Management
Command | Description |
---|---|
sudo apt update |
Update package index |
sudo apt upgrade |
Upgrade all packages |
sudo apt install [package] |
Install a package |
sudo apt remove [package] |
Remove a package |
sudo apt autoremove |
Remove unused dependencies |
apt list --installed |
List installed packages |
4. User Management
Command | Description |
---|---|
adduser [username] |
Add new user |
passwd [username] |
Change user password |
deluser [username] |
Delete a user |
groups [username] |
List user groups |
sudo su |
Switch to root |
5. Networking Commands
Command | Description |
---|---|
ip a |
List network interfaces |
ping [host] |
Ping a server |
traceroute [host] |
Trace packet path |
netstat -tuln |
Show ports and services |
curl [url] |
Make web request |
wget [url] |
Download file from URL |
6. Archive and Compression
Command | Description |
---|---|
tar -czvf file.tar.gz folder |
Create tar.gz archive |
tar -xzvf file.tar.gz |
Extract tar.gz archive |
zip -r file.zip folder |
Create zip archive |
unzip file.zip |
Extract zip archive |
7. Disk and Partition Management
Command | Description |
---|---|
lsblk |
List all drives |
sudo fdisk -l |
View partition table |
df -Th |
Disk usage with types |
mount /dev/sdX /mnt |
Mount a drive |
umount /mnt |
Unmount a drive |
Bonus: Create Aliases
Speed up your workflow with aliases:
alias update='sudo apt update && sudo apt upgrade'
Add this to ~/.bashrc
or ~/.zshrc
to make it permanent.
Conclusion
These commands form the foundation of your Linux terminal journey. Whether you’re managing files, installing software, or configuring a network, knowing these commands will make you more confident in using Ubuntu.
Share this post with friends or save it as your personal cheat sheet.