Shell

Use 'command -v' over 'which' to find a program's executable

Replace which with command -v for POSIX-compliant executable lookup. Learn why command -v is the portable alternative for finding program paths.

Use curly braces while pasting shell commands

Prevent shell commands from executing immediately when pasting. Use curly braces to safely paste multi-line commands with hidden newline characters.

Use strict mode while running bash scripts

Enable Bash strict mode with set -euo pipefail to catch errors early. Exit on failures, treat unset variables as errors, and handle pipeline failures properly.