Rerun the last command with sudo on the Linux shell

Last Updated on May 6, 2021 by admin

Have you ever executed a command on the shell and noticed that you had to run it with sudo? Instead of typing the command again with "sudo" in front of it, just run:

sudo !!

which will execute the command that was run before with sudo. Thanks to Planetfox for this tip.