DEV Community

Abdul Rub
Abdul Rub

Posted on

2

Day 1: Linux Basics โ€“ The Power of Commands ๐Ÿง๐Ÿ’ป

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

  1. 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

11 . ss โ€“ Modern netstat

What it does: Faster socket statistics.

When to use:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • 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:

Image description

  • When a script wonโ€™t run due to "Permission denied".

Top comments (0)

Image of PulumiUP 2025

Let's talk about the current state of cloud and IaC, platform engineering, and security.

Dive into the stories and experiences of innovators and experts, from Startup Founders to Industry Leaders at PulumiUP 2025.

Register Now

๐Ÿ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someoneโ€™s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay