A shell exclamation mark is not for yelling. Be lazy.
Bash, zsh, and csh event designators let you reuse a command’s event, words, and modifiers without repeatedly editing history: sudo !!, !:2*, !$:h, and !ssh:p cover many common cases. The article also explains POSIX fc, which provides editor-backed history editing and substitution even when ! expansion is unavailable.
This is interactive-shell technique, not script advice: history expansion can surprise you, so the article also shows how to disable it. The useful takeaway is a compact vocabulary for reusing paths, flags, and arguments without arrow-key archaeology.