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.

Top 20 Essential Linux Commands Every User Should Know
Discover the 20 most important Linux commands that every beginner should master. Learn how to navigate, manage files, control processes, and work efficiently in the terminal.

🧩 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 /etc
cd ~ # 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/passwd
grep -i "error" /var/log/syslog
grep -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.txt
rm -r old_directory
rm -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 → create
  • x → extract
  • v → verbose output
  • f → specify filename
  • z → 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.sh
chmod 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 1234
kill -9 1234 # force kill

Combine with ps:

ps aux | grep firefox
kill 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

CommandPurposeExample
pwdShow current directorypwd
lsList directory contentsls -lh
cdChange directorycd /etc
catDisplay file contentscat /etc/hosts
grepSearch for textgrep root /etc/passwd
mkdirCreate directoriesmkdir projects
rmDelete files or directoriesrm -rf old/
cpCopy files/folderscp file.txt /tmp/
mvMove/rename filesmv a.txt b.txt
touchCreate empty filetouch new.txt
tarArchive filestar -czvf backup.tar.gz folder/
chmodChange permissionschmod 755 script.sh
chownChange owner/groupchown wang:staff file.txt
dfCheck disk spacedf -h
duCheck directory sizedu -sh *
psList processesps aux
killTerminate processeskill 1234
clearClear screenclear
pingTest networkping google.com
manShow manualman 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:

Or get the full “Linux Command Line for Beginners” eBook on dargslan.com.