Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Linux Commands and Shell Scripting Reference for Linux Admins and DevOps Engineers

Originally published on 2016-03-03; fully revised and updated.

This guide is for Linux administrators, SREs, and DevOps engineers who need a practical path from day-to-day Linux commands to reusable shell automation. It reorganizes the original resource collection into a clearer reference with examples, comparisons, and direct links back to the source materials, including the original post.

How to use this reference effectively

If you are building Linux depth for platform or delivery engineering, use this page in a sequence instead of treating it as a random bookmark dump.

  • Start with user and admin commands to build execution confidence.
  • Move to text-processing tools (grep, sed, xargs) for log and config workflows.
  • Add shell parameters and scripting patterns for repeatable operations.
  • Practice monitoring and troubleshooting commands during real incidents.
  • Use interview sets and exercises to validate practical understanding.
flowchart TD
    A[Learn core user commands] --> B[Learn admin commands]
    B --> C[Practice text processing]
    C --> D[Write simple shell scripts]
    D --> E[Add parameters and logging]
    E --> F[Automate over SSH]
    F --> G[Monitor CPU memory IO]
    G --> H[Troubleshoot and document runbooks]

Command families and DevOps use cases

The original collection spans user-level Linux usage through incident diagnostics and scripting. This table helps you decide where each command family fits.

CategoryExamples from this collectionTypical use in operations
User commandsLinux Commands for User, common Unix utilitiesNavigation, files, permissions, process checks
Admin commandsLinux Commands for Administrator, mount/unmount, df usageHost setup, storage work, access management
Monitoringiostat, mpstat, vmstat, pmapCPU, memory, and disk bottleneck analysis
Text processinggrep, sed, xargsLog filtering, mass changes, command chaining
Remote automationssh-keygen, ssh-copy-id, gshExecuting repeatable tasks across multiple servers

Performance and troubleshooting commands compared

These commands appear frequently in Linux troubleshooting interviews and real production triage.

CommandPrimary focusExampleWhen to run it
iostatDisk I/O and device utilizationiostat -x 1 5Slow builds, high wait time, storage latency suspicion
mpstatCPU utilization by corempstat -P ALL 1 5Thread imbalance or CPU saturation checks
vmstatMemory, swap, run queue, context switchesvmstat 1 5General host pressure triage
pmapMemory map for a processpmap -x 12345Investigating process-level memory growth
xargsBatch argument passingfind /var/log -type f -name “*.log” -print0 | xargs -0 grep -H “ERROR”Applying one command over many files
# Quick triage sequence
iostat -x 1 5
mpstat -P ALL 1 5
vmstat 1 5
pmap -x 12345
find /var/log -type f -name "*.log" -print0 | xargs -0 grep -H "ERROR"Code language: PHP (php)

Shell scripting pattern for routine operations

This example demonstrates common practices from the shell-scripting resources: input parameters, validation, and log-friendly output.

#!/usr/bin/env bash
set -euo pipefail

THRESHOLD="${1:-80}"
LOG_FILE="${2:-/tmp/disk-alerts.log}"

if ! [[ "$THRESHOLD" =~ ^[0-9]+$ ]]; then
  echo "Usage: $0 threshold-percent [log-file]"
  exit 1
fi

df -P | awk 'NR!=1 {print $1,$5,$6}' | while read -r fs use mount; do
  used="$(echo "$use" | tr -d '%')"
  if [ "$used" -ge "$THRESHOLD" ]; then
    echo "$(date '+%F %T') WARN $fs at $use on $mount" | tee -a "$LOG_FILE"
  fi
doneCode language: PHP (php)

Automation example: passwordless SSH setup

The original collection includes a guide for SSH key-based login. A typical flow looks like this:

ssh-keygen -t ed25519 -C "devops@example.com"
ssh-copy-id user@server1
ssh user@server1Code language: JavaScript (javascript)

Curated links from the original collection

The links below are preserved from the original post and grouped by practical usage.

Linux commands and admin fundamentals

Monitoring, filesystem, and remote execution

Shell scripting collection, interview prep, exercises, and videos

Best practices and common pitfalls

  • Do not memorize command flags in isolation; map each command to an operational scenario.
  • Use scripts with parameter validation and predictable defaults.
  • Prefer incremental automation: prove the command manually, then script it.
  • Log script output clearly so incident timelines are easy to reconstruct.
  • Review older tutorials before production use; command options and defaults can change over time.
  • Keep a personal runbook of validated commands for your environment.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Bash Shell Script Parameters: A Practical Reference for Positional and Special Variables

Learn how Bash passes arguments to scripts and how special parameters like $#, $@, $*, $$, and $? behave. This updated reference includes workflow diagrams, comparison tables, and production-friendly examples.

Read More

Reading XML in Shell Scripts: Safer Patterns with xmlstarlet and xmllint

Need to extract values from an XML file in a shell script? This revised guide explains the classic grep/sed approach, its limits, and safer XPath-based alternatives for production automation.

Read More

Chmod: Change File Permissions Recursively

Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have…

Read More

Shell Bash Scripting: Assignment & Excercise – 14

Write a Shell Bash Script for convert Decimal Number to Binary Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about…

Read More

Shell Bash Scripting: Assignment & Excercise – 13

Write a Shell Bash Script for test if a number being entered is a Fibonacci or not Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud,…

Read More

Shell Bash Scripting: Assignment & Excercise – 12

Write a Shell Bash Script for check if a number is prime or not Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x