The Shell's '!' Isn't for Emphasis—It's a Shortcut You're Probably Underusing
Most terminal users know '!!' repeats the last command, but a recent write-up argues that the exclamation mark's full history expansion powers go largely ignored. The shell's '!' operator isn't punctuation for shouting—it's a lazy shortcut for referencing previous commands without retyping them.
The article walks through lesser-known tricks: '!$' grabs the last argument of the previous command, '!^' grabs the first, '!*' grabs all arguments, and '!string' reruns the most recent command starting with that string. You can even combine these with substitution, like '!!:s/old/new/', to fix a typo in your last command without rewriting the whole line.
These features have existed in bash and zsh for decades, inherited from the original C shell, but they're easy to forget since most people rely on up-arrow and tab completion instead.