Welcome back to my #DevOpsJourney! ๐ Yesterday, we explored what DevOps is, why cloud computing is a game-changer, and why Linux is the backbone of DevOps. Today, we dive into Linux commandsโthe essential tools that make Linux a powerhouse for DevOps.
Think of Linux commands like kitchen tools ๐ณโeach has a specific purpose, and mastering them lets you cook up amazing automation, troubleshooting, and system management recipes!
๐ 1. System Monitoring & Resource Management
- top โ The Real-Time System Monitor
What it does: Displays CPU, memory, and process stats.
Real-life analogy: Like checking your carโs dashboard while driving (speed, fuel, engine health).
When to use:
- When your server is slow.
- To find which process is consuming max CPU/RAM.
2 . htop โ Supercharged top
What it does: Colorful, interactive process viewer.
Real-life analogy: Upgrading from a bicycle speedometer to a Teslaโs touchscreen.
When to use:
- When you need a clearer view of processes.
- To kill processes with F9.
3 . ps โ Process Snapshot
What it does: Lists running processes.
Real-life analogy: Taking a roll call in a classroom.
When to use:
- Debugging crashes.
- Checking if a service (e.g., MySQL) is running.
4 . free โ Memory Checker
What it does: Shows RAM and swap usage.
Real-life analogy: Checking your wallet (RAM) and emergency cash (swap).
When to use:
- When apps crash due to "Out of Memory" errors.
5 . df โ Disk Space Analyzer
What it does: Shows disk usage per partition.
Real-life analogy: Checking storage on your phone ("Is there space for an update?").
When to use:
- Before installing large software.
- If your server logs complain about "No space left".
6 . du โ Directory Space Hog Finder
What it does: Checks file/folder sizes.
Real-life analogy: Finding which app is eating your phoneโs storage.
When to use:
- Locating large log files to clean up.
7 . uptime โ Server Lifespan Check
What it does: Shows how long the system has been running.
Real-life analogy: Checking your laptopโs uptime since last reboot.
When to use:
- Debugging unexpected reboots.
๐ 2. Networking โ The Digital Highway
8 . ping โ Network Connectivity Test
What it does: Checks if a server/website is reachable.
Real-life analogy: Knocking on a neighborโs door to see if theyโre home.
When to use:
- Testing if the internet works.
- Troubleshooting "Server not found" errors.
9 . curl โ API/Data Fetcher
What it does: Transfers data via URLs (APIs, downloads).
Real-life analogy: Ordering food via an app (GET/POST requests).
When to use:
- Testing REST APIs.
- Downloading files in scripts.
10 . netstat โ Network Statistician (Legacy, use ss instead)
What it does: Lists active connections and ports.
Real-life analogy: Checking whoโs calling your phone.
When to use:
11 . ss โ Modern netstat
What it does: Faster socket statistics.
When to use:
- Debugging "Port already in use" errors.
12 . traceroute โ Network Path Tracer
What it does: Maps the route packets take to a host.
Real-life analogy: Tracking your pizza delivery route.
When to use:
- Diagnosing slow network speeds.
๐ 3. File & Directory Management
13 . ls โ The Folder Explorer
What it does: Lists files/directories.
Real-life analogy: Opening a drawer to see whatโs inside.
When to use:
- Always. Basic navigation.
14 . grep โ The Text Detective
What it does: Searches for patterns in files.
Real-life analogy: Ctrl+F in a document.
When to use:
- Parsing logs.
- Filtering command outputs.
15 . chmod โ Permission Manager
What it does: Changes file permissions (read/write/execute).
Real-life analogy: Setting a locker combo.
When to use:
- When a script wonโt run due to "Permission denied".
Top comments (0)