6 ms·
IMO, !$ is most useful of them all (it is the one that gets replaced with the last argument of the last command). !! you can do just as easily with up-arrow en
by miki123211 2mo ago
IMO, !$ is most useful of them all (it is the one that gets replaced with the last argument of the last command).
!! you can do just as easily with up-arrow enter, which is just as quick. !ssh you can do with ctrl+r, which actually shows you what it's going to run and whether the last ssh is to where you think it is. sudo !! is up arrow, ctrl+a, 'sudo ', one more keystroke but it's natural if you know your readline. The rest are too complex and not worth learning. !$ is the sweet spot.
- wwfn 2mo agoinstead of !$, I use alt+. for the same reason `up` is preferable to `!!`. !$:h is new to me. directory name of last argument is nice. I can imagine reaching for that. paired with alt-^ to replace the magic with the actual expanded text before hitting enter
- wpm 2mo agothank you for alerting me to the presence of Alt+. No idea how I've missed this for as long as I have
- encom 2mo ago>!! you can do just as easily with up-arrow enter sudo !!
- Crestwave 2mo agoCtrl-P-A then typing sudo is just as easy, it's simply up to preference
- floralhangnail 2mo ago`IMO, !$ is most useful of them all (it is the one that gets replaced with the last argument of the last command).` I've been liking Esc+. for this. It doesn't usually work in browser sessions though, have to do Ctrl+[+. which is a strange feeling 3 finger salute. For some reason I'm able to remember that one rather than !$ Edit: apparently Alt+. does the same, wow.
- db48x 2mo ago[dead]
- deleted 2mo ago[deleted]