# 🐧 Top Linux Commands Every DevOps Beginner Must Know (With Examples)

## 📌 Introduction

If you are starting your journey in **Linux, DevOps, or Cloud Computing**, Linux commands are not optional — they are **mandatory**.

Most production servers run on **Linux**, and as a DevOps engineer, you’ll interact with servers daily for:

* Deployment
    
* Monitoring
    
* Debugging
    
* Automation
    

In this post, I’m sharing a **structured Linux commands cheat sheet (basic + advanced)** with **clear explanations and real examples**, especially useful for **beginners and DevOps learners**.

> 👋 If you found this article helpful and want to follow my **DevOps learning journey**,  
> connect with me on **LinkedIn** 👉 [RamuChelloju](https://www.linkedin.com/in/ramuchelloju/)

---

## 🧱 1. Basic Linux Commands

These commands are used **every day** on any Linux system.

### 🔹 List files and directories

```plaintext
ls
ls -l
ls -a
```

### 🔹 Change directory

```plaintext
cd /var/log
cd ..
```

### 🔹 Show current path

```plaintext
pwd
```

### 🔹 Create and remove directories

```plaintext
mkdir app
rmdir app
```

### 🔹 Copy and move files

```plaintext
cp file1 file2
cp -r dir1 dir2
mv oldname newname
```

### 🔹 Create empty file

```plaintext
touch test.txt
```

---

## 📂 2. File Operations

Used to **read, search, compress, and manage files**.

### 🔹 View file content

```plaintext
cat file.txt
less largefile.log
```

### 🔹 Search inside files

```plaintext
grep "error" app.log
```

### 🔹 Archive and compress

```plaintext
tar -cvf backup.tar folder/
zip files.zip file1 file2
unzip files.zip
```

### 🔹 Change permissions and ownership

```plaintext
chmod 755 script.sh
chown user:group file.txt
```

---

## ⚙️ 3. Process & System Monitoring

Helps you understand **what is running on the server**.

### 🔹 View running processes

```plaintext
ps aux
```

### 🔹 Live system usage

```plaintext
top
htop
```

### 🔹 Run process after logout

```plaintext
nohup python app.py &
```

### 🔹 Process tree

```plaintext
pstree
```

### 🔹 View system logs

```plaintext
journalctl
journalctl -u nginx
```

---

## 💽 4. Disk & Memory Commands

Used heavily during **production issues**.

### 🔹 Disk usage

```plaintext
df -h
du -sh /var/log
```

### 🔹 Memory usage

```plaintext
free -h
```

### 🔹 Block devices

```plaintext
lsblk
```

### 🔹 Mount and unmount

```plaintext
mount /dev/xvdf /data
umount /data
```

### 🔹 Sync files

```plaintext
rsync -av source/ destination/
```

---

## 🌐 5. Networking Commands

Used for **server access and debugging**.

### 🔹 Check connectivity

```plaintext
ping google.com
```

### 🔹 Test APIs and URLs

```plaintext
curl https://example.com
```

### 🔹 Download files

```plaintext
wget https://example.com/file.zip
```

### 🔹 Connect to remote server

```plaintext
ssh -i key.pem user@server_ip
```

### 🔹 Copy files between servers

```plaintext
scp file.txt user@server:/path
```

---

## 🔐 6. Permissions & Ownership (Very Important)

Most Linux issues happen due to **wrong permissions**.

### 🔹 File permissions

```plaintext
chmod 644 file.txt
chmod 755 script.sh
```

### 🔹 Change owner

```plaintext
chown ec2-user:ec2-user file.txt
```

### 🔹 Sudo access

```plaintext
sudo command
```

### 🔹 Edit sudoers safely

```plaintext
visudo
```

---

## 🚀 How DevOps Engineers Use These Commands

As a DevOps engineer, you’ll use Linux commands to:

* Debug production issues
    
* Check server health
    
* Deploy applications
    
* Automate tasks using shell scripts
    
* Manage cloud servers (AWS EC2, GCP, Azure)
    

👉 **Strong Linux basics = Strong DevOps career**

---

## 🧠 Learning Tips for Beginners

* Practice daily (don’t just read)
    
* Break things and fix them
    
* Focus on **understanding**, not memorizing
    
* Combine Linux with Git, Docker, and Cloud
    

---

## ✅ Conclusion

Linux commands are the **foundation** for DevOps, Cloud, and SRE roles.  
Once you master these basics, learning tools like **Docker, Kubernetes, Jenkins, and Terraform** becomes much easier.

If you are a beginner — **start slow, stay consistent, and practice daily**.
