by senjin · 4y ago · 0 comments
sudo !!
for "run the entire previous command under sudo".Another example could be
echo "!!" > myscript
for "save the previous command into the file myscript".The generic form is !n:m for n-th last command line and m-th argument, with an omitted n being a shortcut for the last line.
Not sure if all of this works the same in bash.