Most Common Linux Commands (Complete Beginner to Advanced Guide)

Introduction

Linux is one of the most widely used operating systems in servers, development environments, and cloud infrastructure. Although the terminal may look complex at first, mastering a few basic commands makes system management extremely fast and efficient.

In this guide, we will cover the most commonly used Linux commands, especially:

  • file compression (zip/unzip)
  • file deletion (rm -rf)
  • file search commands

and expand into a complete practical reference.


1. File Compression and Extraction (zip / unzip)

Compress a file (zip)

zip file.zip file.txt

Compress a directory

zip -r folder.zip folder_name/

Extract a zip file (unzip)

unzip file.zip

Extract to a specific directory

unzip file.zip -d target_folder/

2. File Deletion (rm -rf)

⚠️ This command is extremely powerful and dangerous if used incorrectly.

Delete a file

rm file.txt

Delete a directory

rm -r folder_name/

Force delete recursively

rm -rf folder_name/

Explanation:

  • -r → recursive deletion (folders and contents)
  • -f → force delete without confirmation

3. File Search Commands

find command (most powerful search tool)

Search for a file system-wide:

find / -name file.txt

Search in a specific directory:

find /home -name "*.log"

locate command (faster search)

locate file.txt

Update database:

updatedb

4. Viewing File Contents

cat (display full file)

cat file.txt

less (paged view)

less file.txt

head (first lines)

head file.txt

tail (last lines)

tail file.txt

Live log monitoring:

tail -f log.txt

5. File and Directory Management

Create directory

mkdir new_folder

Remove empty directory

rmdir folder_name

Create file

touch file.txt

Copy file

cp file.txt /destination/path/

Move file

mv file.txt /destination/path/

6. System Information Commands

System details

uname -a

Disk usage

df -h

Folder size

du -sh folder_name/

Memory usage

free -h

7. Process Management

List running processes

ps aux

Kill a process

kill PID

Force kill process

kill -9 PID

8. File Permissions

Change permissions

chmod 755 script.sh

Change ownership

chown user:user file.txt

9. Networking Commands

Show IP address

ip a

Ping a server

ping google.com

Check open ports

netstat -tulnp

10. Package Management (Ubuntu / Debian)

Update packages

sudo apt update

Upgrade system

sudo apt upgrade

Install package

sudo apt install nginx

Summary of Most Used Commands

  • zip / unzip → compression
  • rm -rf → deletion (dangerous)
  • find / locate → search files
  • cat / less → view files
  • chmod / chown → permissions
  • ps / kill → process control

Conclusion

Linux command line may seem complex at first, but once you learn the basics, system administration becomes extremely fast and efficient.

The most important areas are:

  • file management
  • search commands
  • system monitoring

After learning these commands, you can handle almost any server task directly from the terminal.

Scroll to Top