A shell exclamation mark is not for yelling. Be lazy. | Filip Roséen

https://refp.se/articles/your-shell-and-the-lazy-exclamation-mark

24 points · 4 comments · view on lemmy.world

4 Comments

cecilkorik@lemmy.ca · 15 pts · 8d (2 replies)

This is interesting, and I am happy to finally understand why "!" always messes up my carefully crafted commands, but for me personally, I'm long past the days when my productivity was ever keystroke-limited so they're simply something I'm not ever going to be interested in saving.

I'm cognitive-load limited now, and saving a few keystrokes compared to "up arrow", "home", "other arrow keys" is not sufficient justification for the additional cognitive load imposed by parsing my brain through this CLI swiss-army-knife, at least for me. Don't let me stop any of you from enjoying it, but my brain does not have sufficient spare processing capacity to handle this. Maybe it did when I was younger, I don't know, but I know it's not useful for how I work now. I spend a lot more time thinking than typing.

dgriffith@aussie.zone · 6 pts · 7d

The only one I use regularly is !! , because it feels good hammering out "sudo !!" in response to yet another attempt by the OS to limit my godlike power in my tiny command-line domain.

Especially punching in those two exclamation marks at the end. It makes it feel like an extra hard JUST DO IT command.

Pomal@sh.itjust.works · 1 pts · 8d
[ removed ]
thingsiplay@lemmy.ml · 4 pts · 8d

Official Bash documentation (should be the same for ZSH too I guess): https://www.gnu.org/software/bash/manual/bash.html#History-Expansion

nostradamnit@piefed.social · 2 pts · 7d

I always use cd blah && cd $_