This question already has an answer here:
- Terminal: prefix previous command? 4 answers
Usually, for some commands such as
apt-get install xxx, I forget to add
sudo first, then I need to retype it. What I want is in such cases, I just type a simple command, for example
resudo. It will sudo my last command
sudo apt-get install xxx. Is it possible in bash?