Inspect command resolution
Show whether a name resolves to an alias, builtin, function, or executable.
type -a lsGreat for debugging unexpected command behavior.
Core Bash builtins, shell options, history, aliases, job control, traps, and interactive-shell behavior.
Frequently used builtins and shell introspection commands.
Show whether a name resolves to an alias, builtin, function, or executable.
type -a lsGreat for debugging unexpected command behavior.
command -v bashPortable pattern for existence checks in scripts.
help readUseful for quick lookup without leaving the terminal.
alias ll='ls -lah'Aliases are best for interactive shells, not scripts.
aliasGood for debugging startup files.
unalias llUse unalias -a to remove all aliases in current shell.
Disable a builtin so external command resolution can win.
enable -n testAdvanced tool mostly used for compatibility and testing.
Modify shell behavior and optional features.
set -oUseful when debugging shell behavior or startup files.
shoptBash separates many optional features under shopt.
shopt -s globstar
printf '%s
' **/*.shVery handy for script discovery and file operations.
shopt -s extglob
printf '%s
' !(*.md)Useful for richer filename matching.
set -fUseful when handling user-provided patterns literally.
Use history builtins and interactive helpers.
history | tailInteractive Bash maintains a history list and file.
fc -s old=newHandy for quick corrections in interactive shells.
bind -P | headUseful when customizing terminal shortcuts.
source ~/.bashrcOften used after editing aliases, exports, or functions.
Background jobs, foreground jobs, and waits.
sleep 60 &The shell prints a job number and PID in interactive mode.
jobs -lInteractive Bash tracks stopped and background jobs.
fg %1Use jobs to inspect job numbers first.
bg %1Common after Ctrl+Z.
pid=$!
wait "$pid"Capture $! right after starting a job.
disown %1Useful when you want a job to survive shell exit semantics.
kill -TERM %1Job specs are very handy in interactive Bash.
Handle signals and cleanup behavior.
trap 'echo interrupted' INTUseful for cleanup and user-friendly interruption.
trap 'status=$?; echo "exiting with $status"' EXITHelpful in wrappers and CI scripts.
trap -pUseful during debugging and library-style shell scripts.