DEV Community

Cover image for Day 2: Linux Basics – Essential Commands (Part 2) 🐧⚑
Abdul Rub
Abdul Rub

Posted on

Day 2: Linux Basics – Essential Commands (Part 2) 🐧⚑

Welcome back to my #DevOpsJourney! In Day 1, we covered system monitoring, networking, and file management. Today, we’ll master process control, text processing, and automation toolsβ€”the secret sauce of DevOps efficiency!

Think of these commands like kitchen gadgets πŸ³β€”each saves time and effort, so you can focus on cooking up great infrastructure!

βš™οΈ 4. Process Management – Controlling Running Apps

16 . kill – The Process Terminator

What it does: Stops misbehaving processes.

Real-life analogy: Force-quitting a frozen app on your phone.

When to use:

Image description

  • When a program hangs or consumes too much CPU.
  • Pro Tip: Find PIDs with ps aux | grep .

17 . killall – Bulk Terminator

What it does: Kills processes by name.

Real-life analogy: Turning off all lights in a room with one switch.

When to use:

Image description

  • When multiple instances of a service need restarting.

18 . bg & fg – Multitasking Wizards

What they do:

bg resumes a paused job in the background.

fg brings it back to the foreground.

Real-life analogy:

bg β†’ Minimizing YouTube to work.

fg β†’ Bringing it back to watch.

When to use:

Image description

19 . jobs – Background Task Manager

What it does: Lists background/suspended jobs.

Real-life analogy: Checking your to-do list sticky notes.

When to use:

Image description

  • Managing long-running tasks (e.g., backups).

πŸ“œ 5. Text Processing – Data Manipulation

20 . sed – The Text Surgeon

What it does: Finds/replaces text in files or streams.

Real-life analogy: Find & Replace All in a Word doc.

When to use:

Image description

  • Editing config files in bulk.
  • Removing empty lines: sed '/^$/d' file.txt.
  1. awk – The Data Scientist

What it does: Extracts and processes structured data (e.g., logs, CSVs).

Real-life analogy: Filtering Excel columns for analysis.

When to use:

Image description

  • Parsing server logs.
  • Calculating sums: awk '{sum+=$1} END {print sum}' data.txt.

22 . cut – The Column Cutter

What it does: Extracts specific columns from text.

Real-life analogy: Cutting coupons from a newspaper.

When to use:

Image description

  • Processing CSV/TSV files.

23 . tr – The Character Translator

What it does: Replaces/deletes characters.

Real-life analogy: Converting lowercase to uppercase with a button.

When to use:

Image description

  • Sanitizing inputs (e.g., removing spaces).

πŸ”— 6. File Linking & Archives

24 . ln – The Shortcut Creator

What it does: Creates hard/soft links (like Windows shortcuts).

Real-life analogy:

Hard link: A mirror (same file, two names).

Soft link: A GPS shortcut (points to original).

When to use:

Image description

  • Linking config files across directories.

25 . tar – The File Packer

What it does: Combines files into a tarball (.tar.gz).

Real-life analogy: Zipping clothes into a suitcase.

When to use:

Image description

  • Creating backups.

26 . zip/unzip – Cross-Platform Archiver

What it does: Compresses to .zip format.

Real-life analogy: Packing files for email attachments.

When to use:

Image description

  • Sharing files with Windows users.

Top comments (0)