Pipe output to two commands with tee
A pipe has one reader, so feeding two commands needs tee. Copy a stream to a file, append with tee -a, fan out with process substitution, and read PIPESTATUS.
Filtering by topic #bash · clear
A pipe has one reader, so feeding two commands needs tee. Copy a stream to a file, append with tee -a, fan out with process substitution, and read PIPESTATUS.
Argument list too long is the kernel refusing an oversized exec, and the glob you typed is usually why. Reproduce it, then fix it with xargs or find.
Sourcing a bash script runs it in your current shell. Executing forks a child. Why cd and export do not stick, and why source can close your session.
Bash globbing explained: how the shell expands wildcards into filenames before a command runs, plus nullglob, dotglob, globstar and extglob negation.
!! repeats the last command and !$ gives you its last argument. Learn the six bash history expansions worth knowing, plus :p to print one before it runs.
Why $(...) runs in a subshell, so cd and variables vanish, why backticks nest badly, and the process substitution tricks that keep state in your shell.