Your shell's exclamation mark isn't for yelling—it's for being lazy
A shell exclamation mark is not for yelling. Be lazy.

Event designators in bash, zsh, and other shells let you repeat commands and reuse arguments without arrow-key mashing. This guide covers the basics—like `!!` and `!$`—and dives into word designators and modifiers that slice up previous commands. It also highlights `fc`, a POSIX tool that opens your command history in your editor for powerful batch edits. Learn the essential shortcuts, how to verify expansions safely, and how to disable or customize the `!` trigger if it gets in your way.
Exclamation marks are not for shouting—at least not in your shell.
- jwr
I got used to doing this over many many years with the tcsh shell. I switched to Fish recently and I continue to be annoyed by its refusal to implement this feature. Yes, I tried using all the newfangled history-search thingamajigs. They all kind of work, and they all have their issues. But the !, together with in-place expansion, is something I still dearly miss.
- userbinator
Every time someone brings this up, I think "oh right, I could do that" and then immediately forget. Especially if you can type quickly, it's easier to just "drive straight ahead" with the command you want, than add another "mental branch" to interrupt the flow. For the same reason I'll often Ctrl+C and start again instead of trying to backspace and correct.
- inigyou
This is for teletypewriters. For those of us with interactive electronic video displays, we can use up-arrow to recall the last command or Ctrl-R to search history, then edit the recalled command.
- somat
> who haven't wished they could edit their long commands in an editor rather than in the shell?
That's called a shell script. I don't know what others thresholds are but mine is about three pipelines deep(or 80 characters whatever comes first) and I am going to write that son of a gun as a script. Mainly to have something named in the filesystem I can edit, same with my sql queries, I have a whole directory of long awkward mostly one off queries, psql has the \e command which helps but again I would rather have something named.
- Terr_
Rather than a sense of "cool" or "useful" somehow I end up just feeling despair at how organically convoluted it is to determine what something on a command-line really does. To be fair, I've always been biased towards "only the simplest scripts should be in shell languages."
This also adds an intriguing new dimensions to reviewing/verifying shell commands as benign and correct... How long until LLMs start (ab)using the trick in little requests they want me to approve?