Linux & DevOps Battle-Tested Bash Recipes
Production-ready one-liners for troubleshooting high load, parsing access logs, inspecting memory leaks, and container diagnostics.
Top 10 CPU Consuming Processes
Displays the top 10 running processes consuming the most CPU cycles, including PID and memory utilization.
Top 10 Memory Consuming Processes
Sorts all system processes in descending order of physical RAM usage.
Live System Bottleneck Overview
Reports virtual memory statistics, CPU user/system/idle/wa (I/O wait) ticks every second for 5 iterations.
Inspect Out-Of-Memory (OOM) Killer Logs
Scans the kernel ring buffer with human timestamps to check if Linux invoked the OOM killer on rogue processes.
Clear Linux PageCache, Dentries and Inodes
Flushes dirty pages to disk and safely drops unneeded cached memory from kernel RAM.
Find Top 20 Largest Files on Filesystem
Searches the root partition without crossing filesystem boundaries for individual files larger than 100MB.
Interactive Disk Space Analyzer
Launches an interactive ncurses directory size browser confined to the primary root filesystem.
Vacuum Systemd Journal Logs Over 500MB
Safely prunes persistent systemd journal logs keeping only the last 14 days or maximum 500MB.
Find Deleted Files Still Held Open in RAM
Identifies deleted log files that are still holding disk space because active processes keep their file handles open.
List All Listening TCP and UDP Ports with Process Names
Displays all active listening sockets, binding IP addresses, ports, and associated process names/PIDs.
Identify What Process is Listening on a Specific Port
Instantly looks up the process name, user, and PID binding TCP port 8080.
Kill Whatever Process is Holding a Port Open
Sends SIGKILL to any local process binding port 8080 so a crashed daemon can restart.
Test Remote TCP Socket Connection with Netcat
Probes an IP and port for TLS/TCP handshake availability with a 3-second timeout.
Check HTTP Response Headers and TLS Handshake Latency
Performs verbose HTTP/2 / HTTP/3 header negotiation and SSL certificate validation.
Trace Complete DNS Resolution Hierarchy
Follows the recursive DNS delegation starting from root nameservers down to authoritative nameservers.
Live Capture HTTP/HTTPS Traffic on eth0
Sniffs and displays 50 live packets traversing web ports without resolving hostnames.
Extract Top 10 Requesting Client IPs from Nginx Log
Parses standard web access logs and prints the top 10 IP addresses by hit frequency.
Count HTTP Response Status Codes in Access Log
Groups and counts HTTP return codes (200, 301, 404, 500, 502) to detect application anomalies.
Real-Time Tail Log Highlighting Errors in Red
Follows syslog stream with colored highlights on warning and error strings.
Inspect SSL Certificate Expiration and Subject Info
Reads an X.509 certificate and prints the expiration timestamp and Common Name (CN).
Verify Remote Server TLS Certificate Expiration Date
Establishes a live TLS handshake with SNI and returns valid-from and valid-to certificate dates.
Generate High-Entropy 32-Character Random Password
Generates a cryptographically strong, clean password using OpenSSL random entropy.
Docker Container Real-Time CPU and Memory Monitor
Streams real-time container resource consumption in an organized terminal table.
Find IP Address of Running Docker Container
Inspects container network namespace and returns the assigned internal bridge IP.
Purge All Dangling Docker Images, Containers and Volumes
Reclaims disk space by purging stopped containers, unused networks, and dangling volumes.
Kill Defunct / Zombie Processes
Finds zombie processes and signals their parent PIDs to clean up lingering process table entries.
Compare Two Directories Recursively for Differences
Recursively reports files that are present in only one directory or differ in content.
Check Disk I/O Read/Write Speed via Direct I/O
Bypasses operating system buffer cache to measure raw sequential NVMe/SSD write throughput.
Find Files Modified Within the Last 60 Minutes
Rapidly detects freshly uploaded or altered files across a web tree.
Convert JSON File to Formatted Table via jq
Transforms an array of JSON objects into an aligned human-readable terminal table.