Hey Ubuntu/Linux fans, today I thought of coming up with a list of the most important Linux commands you need to navigate your system(s) like a pro.
These commands work across most Linux distributions, from Ubuntu to Fedora, Debian, and beyond.
Whether you’re a new to Linux and or Ubuntu or a seasoned sysadmin vet with 15+ years of experience in the field…these will save you time and give you ultimate control when you need it most.
Download Your Linux Commands Cheat Sheet
I’ve created a handy cheat sheet with the top Linux commands to keep at your fingertips. Grab it in your preferred format:
What Are Linux Commands?
Linux commands are text-based instructions you type into the terminal to control your system without a mouse. They’re case-sensitive, follow a format like command -options arguments
, and can be chained for complex tasks.
Why use them? They offer precise control, automate repetitive tasks, and are crucial for managing servers or accessing system resources like files, networks, and CPU.
No Linux setup yet? Check out my guide on the best Linux VPS providers or explore Linux courses with certificates to level up.
Best Linux Commands You Need to Know
Here’s a list of essential commands, organized for easy navigation. They work on most Linux distros, including Ubuntu, Debian, CentOS, Linux Mint, PopOS and more.
File Management Commands
These commands help you navigate, create, and manage files and directories.
Command | Description | Syntax | Example |
---|---|---|---|
pwd |
Shows current directory path | pwd |
pwd → /home/user |
ls |
Lists directory contents | ls [options] [directory] |
ls -la → Lists all files, including hidden |
cd |
Changes directory | cd [directory] |
cd Documents → Navigates to Documents |
mkdir |
Creates a new directory | mkdir [options] |
mkdir project → Creates “project” folder |
rmdir |
Removes empty directories | rmdir |
rmdir oldfolder → Deletes empty “oldfolder” |
touch |
Creates empty files or updates timestamps | touch |
touch notes.txt → Creates “notes.txt” |
cat |
Displays or concatenates file contents | cat [options] |
cat file.txt → Shows “file.txt” content |
cp |
Copies files or directories |
|
cp file.txt backup.txt → Copies “file.txt” |
mv |
Moves or renames files/directories |
|
mv old.txt new.txt → Renames “old.txt” |
rm |
Deletes files or directories | rm [options] |
rm -r folder → Removes “folder” recursively |
Pro Tip: Use ls -lh
for human-readable file sizes (e.g., MB). Great for spotting storage hogs!
Text Editing Commands
Edit files directly in the terminal with these editors.
Command | Description | Syntax | Example |
---|---|---|---|
nano |
Simple text editor | nano |
nano notes.txt → Opens “notes.txt” in Nano |
vi |
Powerful text editor | vi |
vi script.sh → Opens “script.sh” in vi |
Pro Tip: New to vi
? Press i
to insert, :wq
to save and quit, or :q!
to quit without saving.
Permissions and Ownership Commands
Control file access and ownership.
Command | Description | Syntax | Example |
---|---|---|---|
chmod |
Changes file permissions | chmod [options] |
chmod 755 script.sh → Sets executable permissions |
chown |
Changes file owner/group | chown [owner][:group] |
chown user:user file.txt → Sets owner to “user” |
Search and Text Processing Commands
Find files or search text within them.
Command | Description | Syntax | Example |
---|---|---|---|
find |
Searches for files/directories | find [path] [options] |
find /home -name "*.txt" → Finds all .txt files |
grep |
Searches text patterns in files | grep [options] |
grep "error" log.txt → Finds “error” in “log.txt” |
System Monitoring Commands
Monitor your system’s performance.
Command | Description | Syntax | Example |
---|---|---|---|
ps |
Shows running processes | ps [options] |
ps aux → Lists all processes |
top |
Real-time system monitoring | top |
top → Interactive process viewer |
df |
Reports disk space usage | df [options] |
df -h → Shows disk usage in MB/GB |
du |
Estimates file/directory size | du [options] [directory] |
du -sh /folder → Shows folder size |
free |
Displays memory usage | free [options] |
free -m → Shows memory in MB |
Pro Tip: Try htop
(install with sudo apt install htop
on Debian-based systems) for a colorful alternative to top
.
System Information Commands
Get system details fast.
Command | Description | Syntax | Example |
---|---|---|---|
uname |
Shows system info | uname [options] |
uname -a → Displays kernel version |
uptime |
Shows system uptime | uptime |
uptime → Shows system runtime |
whoami |
Displays current user | whoami |
whoami → Outputs your username |
hostname |
Shows system hostname | hostname |
hostname → Outputs system name |
Package Management Commands
Install and manage software packages.
Command | Description | Syntax | Example |
---|---|---|---|
apt-get |
Debian-based package manager | apt-get [options] |
sudo apt-get install vim → Installs vim |
yum |
RPM-based package manager | yum [options] |
sudo yum install nano → Installs nano |
Pro Tip: On Fedora, use dnf
instead of yum
for newer package management.
Archiving and Compression Commands
Manage archives and compress files.
Command | Description | Syntax | Example |
---|---|---|---|
tar |
Creates/extracts archives | tar [options] |
tar -cvf archive.tar /folder → Creates archive |
zip |
Compresses files to zip | zip [options] |
zip archive.zip file.txt → Zips file |
unzip |
Extracts zip files | unzip |
unzip archive.zip → Extracts files |
Network Commands
Handle network tasks like downloads or remote access.
Command | Description | Syntax | Example |
---|---|---|---|
wget |
Downloads files from web | wget [options] |
wget https://example.com/file.zip → Downloads file |
curl |
Transfers data via protocols | curl [options] |
curl -O https://example.com/file → Downloads file |
ssh |
Secure remote login | ssh user@hostname |
ssh [email protected] → Connects to remote host |
scp |
Securely copies files |
|
scp file.txt user@host:/path → Copies file |
rsync |
Synchronizes files |
|
rsync -avz /local/ user@host:/remote/ → Syncs folders |
Miscellaneous Commands
Command | Description | Syntax | Example |
---|---|---|---|
man |
Shows command help | man |
man ls → Displays ls manual |
history |
Shows command history | history |
history → Lists past commands |
clear |
Clears terminal screen | clear |
clear → Wipes terminal |
cron |
Schedules tasks | crontab -e |
crontab -e → Edits cron jobs |
Pro Tip: Use man
(e.g., man grep
) for detailed options. It’s your built-in guide!
Why These Commands Matter
These commands are the backbone of Linux system administration, working across distros like Ubuntu, Fedora, and Debian.
They let you manage files, monitor resources, automate tasks, and troubleshoot issues. I’ve used rsync
to back up websites and grep
to find log errors, they’re total game-changers.
Got questions or want to share your favorite commands? Feel free to contact us or leave a comment below!
Explore More Linux Command Guides
Want to dive deeper? Check out these related posts:
- Top Linux Networking Commands + Free Cheat Sheet
- Advanced Linux Commands for Power Users
- Important Linux Security Commands
- Wget Command Cheat Sheet
- Sudo Command Cheat Sheet