Recently, I was getting a bit frustrated about not running commands as admin, and started using sudo !!
a lot. I decided that, for ease of use, I'd create an alias ffs
for that exact line. I added the following line...
alias ffs="sudo !!"
to my .zshrc
.
However, when I tried using it, entering ffs
into the terminal spat out an error:
sudo: !!: command not found
Why does the command not work when invoked using an alias? What can be used to fix this/instead of this to just rerun the previous command? Thanks in advance!
alias sudo !!
? – ilkkachu Oct 16 '21 at 10:49$(fc -nl -1)
seems to work on zsh too (the one with history -p doesn't, it pushes the history list to a stack...). – ilkkachu Oct 16 '21 at 11:45