Top 20 Essential Linux Commands Every User Should Know
The Linux terminal might seem intimidating at first, but it’s the most powerful tool you can learn. In this guide, we’ll explore the 20 essential commands every user should know — from navigation to file management, system monitoring, and beyond.
🧩 Introduction: Why Learn Linux Commands?
If you want to truly understand Linux, you must get comfortable with the command line.
While graphical interfaces exist, every serious system administrator, developer, and DevOps engineer relies on the terminal to control their system precisely.
Why?
Because the command line gives you speed, automation, and control that no GUI can match.
In this guide, you’ll discover 20 of the most important Linux commands, each explained with clear examples.
Whether you’re a beginner or a professional refreshing your skills, this list will help you work efficiently and confidently on any Linux distribution.
🧭 1. pwd – Print Working Directory
This command shows you where you are in the file system.
pwd
Example output:
/home/wang/projects
Every time you open a terminal, it starts in a directory — often your home folder.pwd helps you orient yourself before executing further commands.
📂 2. ls – List Files and Directories
ls lists the contents of your current directory.
Add options to view more details:
ls -l # long format
ls -a # show hidden files
ls -lh # human-readable sizes
ls -ltr # sort by modification date
You’ll use ls constantly for file exploration and system inspection.
🚪 3. cd – Change Directory
Move between directories easily:
cd /etccd ~ # go to home
cd .. # go up one level
cd /var/log # navigate directly
Tip: cd - returns you to your previous directory, a handy shortcut.
📄 4. cat – Display File Contents
cat prints the contents of a file to the terminal.
cat /etc/hostname
For longer files, combine it with less or more to scroll:
cat /var/log/syslog | less
🔍 5. grep – Search Inside Files
One of the most powerful commands in Linux.
It searches for text patterns within files.
grep "root" /etc/passwdgrep -i "error" /var/log/sysloggrep -r "config" /etc
Options:
-i→ ignore case-r→ recursive search--color→ highlight matches
🧱 6. mkdir – Create Directories
To make a new folder:
mkdir backups
To create nested directories:
mkdir -p projects/2025/python
The -p flag automatically creates parent directories as needed.
🗑️ 7. rm – Remove Files and Directories
Use with care — there’s no undo.
rm file.txtrm -r old_directoryrm -rf /tmp/test
Options:
-r→ recursive (for directories)-f→ force deletion without confirmation
💀 Warning: Avoid running rm -rf / as root — it will erase your system.
✂️ 8. cp – Copy Files and Folders
cp file.txt /home/wang/backup/cp -r docs/ /home/wang/archive/
Add -i to ask for confirmation before overwriting:
cp -i config.txt /etc/
🔁 9. mv – Move or Rename Files
mv file.txt /home/wang/docs/mv oldname.txt newname.txt
It’s often used to rename files — just provide a new name as the target.
📝 10. touch – Create Empty Files or Update Timestamps
touch newfile.txt
If the file doesn’t exist, touch creates it.
If it already exists, it updates its modification date — useful for scripting and automation.
📦 11. tar – Archive and Compress Files
tar combines multiple files or folders into a single archive.
tar -cvf backup.tar folder/
tar -xvf backup.tar
tar -czvf backup.tar.gz folder/
tar -xzvf backup.tar.gz
Options:
c→ createx→ extractv→ verbose outputf→ specify filenamez→ use gzip compression
🔒 12. chmod – Change File Permissions
We discussed this in detail in How to Manage File Permissions in Linux.
Quick recap:
chmod 755 script.shchmod u+x run.sh
It defines who can read (r), write (w), or execute (x) a file.
👑 13. chown – Change File Ownership
Modify the owner and group of a file or folder:
chown wang:developers project/sudo chown root /etc/ssh/sshd_config
Use -R to apply changes recursively.
🧮 14. df – Check Disk Usage
View available disk space on mounted filesystems:
df -h
Output includes the size, used, and available space in human-readable format.
📊 15. du – Display Directory Sizes
Find out which folders use the most space:
du -sh *du -h --max-depth=1 /var
Great for detecting large directories and cleaning up unnecessary files.
⚙️ 16. ps – View Running Processes
Check what’s running on your system:
ps aux
Combine with grep to filter results:
ps aux | grep nginx
For interactive monitoring, use top or htop.
💣 17. kill – Terminate Processes
End a process using its PID (Process ID):
kill 1234kill -9 1234 # force kill
Combine with ps:
ps aux | grep firefoxkill 9876
🧹 18. clear – Clean the Terminal Screen
Simply clears your terminal window for a fresh view:
clear
Shortcut: press Ctrl + L.
🌍 19. ping – Test Network Connectivity
Check if a host or website is reachable:
ping google.com
ping -c 5 8.8.8.8
Use Ctrl + C to stop it.
If you can’t ping, your network or DNS configuration might be broken.
🔁 20. man – Read Command Manuals
Never guess — read the manual page.
man ls
man chmod
Press q to exit the manual.
You can also use --help for shorter info:
ls --help
⚡ Bonus Tip: Combine Commands with Pipes
Linux shines when you chain commands together:
ps aux | grep python | wc -l
This example counts how many Python processes are running.
That’s the real power of Linux — small tools combined to do big things.
🧠 Summary Table: 20 Essential Commands
| Command | Purpose | Example |
|---|---|---|
pwd | Show current directory | pwd |
ls | List directory contents | ls -lh |
cd | Change directory | cd /etc |
cat | Display file contents | cat /etc/hosts |
grep | Search for text | grep root /etc/passwd |
mkdir | Create directories | mkdir projects |
rm | Delete files or directories | rm -rf old/ |
cp | Copy files/folders | cp file.txt /tmp/ |
mv | Move/rename files | mv a.txt b.txt |
touch | Create empty file | touch new.txt |
tar | Archive files | tar -czvf backup.tar.gz folder/ |
chmod | Change permissions | chmod 755 script.sh |
chown | Change owner/group | chown wang:staff file.txt |
df | Check disk space | df -h |
du | Check directory size | du -sh * |
ps | List processes | ps aux |
kill | Terminate processes | kill 1234 |
clear | Clear screen | clear |
ping | Test network | ping google.com |
man | Show manual | man ls |
🧩 Wrapping Up: Mastering the Command Line
Learning Linux commands is not about memorization — it’s about understanding patterns.
Once you see how commands work together, you’ll navigate, configure, and automate tasks faster than ever before.
Start by practicing a few each day.
Combine them into short scripts, and soon you’ll find yourself thinking in commands, not clicks.
“The Linux command line is not a tool — it’s a superpower.” ⚡
🧭 Next Steps
Continue your Linux journey with these guides:
- Understanding the Linux File System: A Beginner’s Guide
- How to Manage File Permissions in Linux
- Monitoring System Performance with top, htop, and iostat
Or get the full “Linux Command Line for Beginners” eBook on dargslan.com.