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.
| Category | Examples from this collection | Typical use in operations |
|---|---|---|
| User commands | Linux Commands for User, common Unix utilities | Navigation, files, permissions, process checks |
| Admin commands | Linux Commands for Administrator, mount/unmount, df usage | Host setup, storage work, access management |
| Monitoring | iostat, mpstat, vmstat, pmap | CPU, memory, and disk bottleneck analysis |
| Text processing | grep, sed, xargs | Log filtering, mass changes, command chaining |
| Remote automation | ssh-keygen, ssh-copy-id, gsh | Executing repeatable tasks across multiple servers |
Performance and troubleshooting commands compared
These commands appear frequently in Linux troubleshooting interviews and real production triage.
| Command | Primary focus | Example | When to run it |
|---|---|---|---|
| iostat | Disk I/O and device utilization | iostat -x 1 5 | Slow builds, high wait time, storage latency suspicion |
| mpstat | CPU utilization by core | mpstat -P ALL 1 5 | Thread imbalance or CPU saturation checks |
| vmstat | Memory, swap, run queue, context switches | vmstat 1 5 | General host pressure triage |
| pmap | Memory map for a process | pmap -x 12345 | Investigating process-level memory growth |
| xargs | Batch argument passing | find /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
- Linux Commands for User
- Linux Commands reference in scmGalaxy forum
- Linux Commands for Administrator
- Main Responsibilities of the Linux System Administrator
- Common unix commands and utilities
- Unix Command: Grep
- Unix Sed Quick Reference
- VI/VIM editor Commands
- Understanding Epoch & Unix Timestamp
Monitoring, filesystem, and remote execution
- 20 pmap Commands Examples in Linux / UNIX
- 20 mpstat Commands Examples in Linux / UNIX
- 20 iostat Commands Examples in Linux / UNIX
- 20 vmstat Commands Examples in Linux / UNIX
- Linux Performance Monitoring using iostat, mpstat and vmstat
- 20 Xargs Commands Examples in Linux / UNIX
- 20 Mount and Unmount Filesystem / Partition commands in Linux / UNIX
- Steps to Perform SSH Login Without Password Using ssh-keygen and ssh-copy-id
- gsh – Run linux commands on many other linux server at once
- Configuring NFS to access the files from remote Linux machine as a mount point
Shell scripting collection, interview prep, exercises, and videos
- Interview Questions Sets : Shell Script Descriptive
- Interview Questions & Answer Sets : Shell Programming
- Must have collection of shell script for any SCM admin
- Frequently Used Shell Script
- Shell Script collection in scmGalaxy Forum
- Automate mandatory user-parameter in Shell Script using expect
- Various Commands to send an email in Linux
- df advance command usage
- FTP commands for Linux / Unix
- ShellScript to monitor available disk space on AIX
- Find Linux Command Collection
- Disable IPv6 and Enable IPv4 in Red Hat Linux
- Linux Shell Scripting Units and Exercise Unit – 1
- Linux Shell Scripting Units and Exercise Unit – 2
- Linux Shell Scripting Units and Exercise Unit – 3
- Linux Shell Scripting Units and Exercise Unit – 4
- Linux Shell Scripting Units and Exercise Unit – 5
- If a linux-build-server suddenly starts getting slow, what would you check?
- Start Your Quiz
- Test Your Linux Skills via these Exercise
- Recovering a Recently opended deleted files
- Bash Scripting CBT
- Linux Comammands & Shell Scripting Youtube
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.
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.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals