grep -rl "shell" ./blog

Linux Shells

The program that interprets your commands: what a shell is, how it differs from the terminal, and the environment it maintains.

17 articles

Debugging Bash Scripts: set -x, PS4, and ShellCheck How to find out what a misbehaving shell script is actually doing: syntax checks with bash -n, tracing with set -x and a better PS4, tracing to a file, catching errors with trap, and finding bugs before they run with ShellCheck. fzf and ripgrep Explained: Faster Searching in the Terminal ripgrep searches file contents faster than grep and respects .gitignore; fzf turns any list into an interactive fuzzy finder. How each works, the shell keybindings that change daily terminal use, and how to combine them. Neovim Basics: Getting From Vim to a Modern Editor Setup Neovim keeps Vim's modal editing and adds Lua configuration, a built-in LSP client, Tree-sitter highlighting, and a plugin ecosystem built around them. How it differs from Vim, a minimal init.lua, and how to add language support. Rust Coreutils Explained: What uutils Changes on Ubuntu and What Still Differs From GNU Ubuntu now ships uutils, a Rust rewrite of ls, cp, cat and the rest of coreutils, in place of the GNU versions. What changed, why Canonical did it, where the two still behave differently, and how to switch back. bashrc vs bash_profile vs profile: Which File to Put Things In Login shells read one set of files, interactive shells read another, and non-interactive shells read almost nothing. That is why your PATH works in a terminal and not in cron, and why your alias vanishes over ssh. getopts Explained: Parsing Script Arguments Without Regret Reading positional parameters works until someone passes flags in a different order. getopts is built into bash and handles short options properly, getopt handles long ones, and there is a reason to avoid one of them. Shell Completion: How It Works and How to Write Your Own Why Tab knows your command options, where completion scripts live, and writing one for your own tool in bash and zsh. trap and Signal Handling in Shell Scripts Cleaning up temporary files on exit, handling Ctrl+C properly, and why EXIT is the only trap most scripts need. Customizing Your Bash Prompt with PS1 How PS1 works, why unescaped colour codes wrap your lines wrongly, showing Git branch and exit status, and when to stop hand-rolling and use Starship. Locale and Internationalization on Linux What LANG and the LC_ variables control, why sort output changes between machines, and why scripts should set LC_ALL=C. Zsh vs Bash vs Fish: Choosing an Interactive Shell Bash is everywhere and scripts run on it. Zsh has the best completion. Fish is the most pleasant out of the box and is not POSIX compatible. Here is what that actually costs. Bash Quoting Explained: The Single Biggest Source of Shell Bugs Word splitting and glob expansion on unquoted variables cause more shell breakage than any other single mistake. Here is exactly what each quoting style does and when to use it. Heredocs and Process Substitution in Bash Feed multi-line text to a command without a temporary file, and present a command's output where a filename is expected. Two syntaxes that remove most of the need for temporary files in scripts. Bash Arrays and Parameter Expansion Arrays handle lists of things without word splitting bugs, and parameter expansion does substring, default, and pattern operations without launching sed. Both remove whole categories of shell mistakes. Environment Variables and PATH Explained Environment variables control how your shell and the programs it launches behave, and PATH is the most important one, determining which commands your system can find. This guide covers viewing, setting, and permanently persisting environment variables. I/O Redirection and Pipes Explained Every Linux command reads from standard input and writes to standard output and standard error. This guide explains those three streams and how to redirect and chain them with >, >>, <, 2>&1, pipes, and xargs. Writing Your First Bash Script A practical introduction to Bash scripting: the shebang line, variables, arguments, conditionals, loops, and functions, with runnable examples you can adapt for real automation tasks.