I often forget to run commands with sudo. I\'m looking for a way to make a bash function (or alias) for repeating the last command with sudo. Something
Use alias redo='sudo $(history -p !!)'. This is the only thing that I
have found that works with aliases. The other answers do not work in aliases for some reason, having tried them myself, even though they do work when directly running them.