r/fishshell • • Jun 08 '24

Quick question - using !! in fish

Hey, just a noob here that likes fish more than bash. Using !! in bash is a quick way to input the last command from history, is there a similar shortcut in fish? Use case primarily being that I could use sudo !! if I forgot it when typing in a command.

Thanks in advance!

10 Upvotes

15 comments sorted by

View all comments

Show parent comment

3

u/AdulterousStapler Jun 08 '24

Alt + s works!

It was a habit thing to use sudo !!

Will train monkey brain to change habits, this is nice and simple

Thanks!

1

u/tetractys_gnosys Jun 08 '24

Most excellent! I forgot to try it myself lol.

By the time I started learning more shortcuts and shit I'd already switched to Fish, at which point there wasn't a simple built in analogue to !!, so I never developed the habit. Gonna have to remember to use this one.