Bash history expansion: !! and !$
!! 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.
Filtering by topic #bash · clear
!! 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.