The shell command list you get with `history` is numbered. You can repeat a specific command with `!<number>`. A bit convoluted. What I do more often is repeating the previous command with `!!`. For example, when I forgot to use `sudo`, I simply go `sudo !!`.