Tag: scripting
All the articles with the tag "scripting".
-
Bash Strict Mode: set -euo pipefail Explained
set -euo pipefail makes your bash scripts fail fast instead of silently. Here's what each flag does and why they matter.
-
awk for Log Parsing: 5 Patterns You'll Actually Use
awk is perfect for parsing logs. Here are 5 patterns that handle filtering, summing, counting, splitting fields, and pretty-printing without reaching for Perl or Python.
-
jq One-Liners Every Sysadmin Needs
jq is JSON on the command line. Here are 5 one-liners that actually solve real problems: filtering, extracting, transforming, combining, and debugging.
-
xargs vs while read: Which One and When
xargs and while read both loop over input, but they handle arguments, signals, and performance differently. Here's when to use each.
-
find Flags You Keep Forgetting
Practical find command examples: -mtime, -newer, -type, -exec vs xargs, -not, size filters. The patterns you google every time.
-
Techniques for Writing Robust, Reliable Bash Scripts
Write bash scripts that don't silently fail — set -euo pipefail, error handling, input validation, and logging patterns for production scripts.
-
Preserving Bash History in Multiple Terminal Windows
By default bash history is lost across multiple terminal sessions. Fix it with HISTAPPEND and PROMPT_COMMAND so nothing gets overwritten.
-
Finding the PID of a Process Using a Specific Port in Linux
Something's squatting on port 8080 and you need to know what. ss, lsof, and fuser one-liners to find and kill the culprit fast.
-
Differences Between nohup, disown, and & in Linux
nohup, disown, and & all keep processes running after logout — but they work differently. Here's which one to reach for and why.
-
Understanding printf vs echo in Bash
echo is convenient but inconsistent across systems; printf is portable and precise — know when to use each and avoid the gotchas.
-
Understanding Grep: A Comprehensive Guide
grep is more powerful than you think — regex patterns, context flags, recursive search, and piping tricks that save hours of log digging.
-
Essential Linux Commands for Daily Use
The Linux commands every sysadmin reaches for daily — file ops, process management, networking, and text manipulation you can't live without.