Tag: bash
All the articles with the tag "bash".
-
String Manipulation in Bash (Without sed or awk)
Bash has built-in string operations: substring extraction, find-replace, case conversion, and trimming. You don't need sed for basic text work.
-
bash `set -e` Doesn't Work Like You Think
set -e silently fails in subshells, pipes, and conditionals. Learn the gotchas and fix them.
-
Bash Arithmetic Without bc
Bash has built-in arithmetic. You don't need bc for 90% of math. Here's how to do it right.
-
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.
-
Where Environment Variables Actually Live in Linux
Navigate /etc/environment, ~/.bashrc, ~/.profile, and systemd Environment=. When to use each.
-
Why Your Cron Job Is Failing Silently
PATH is different in cron, stdout is muted, and MAILTO breaks silently. Learn cron traps and how to debug them.
-
find Flags You Keep Forgetting
Practical find command examples: -mtime, -newer, -type, -exec vs xargs, -not, size filters. The patterns you google every time.
-
Why kill -9 Is the Wrong Default
Signals explained: SIGTERM vs SIGKILL, graceful shutdown, and when to actually use kill -9.
-
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.