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?
migrated from stackoverflow.com Feb 19 '11 at 15:23
You could just use bash's
Anyway bash offers many shortcuts for anything, you could just press the up arrow (in order to get back the last typed line), then press