Reuse and expand the shell history in `sh`, `bash`, `zsh`, `rbash` and `ksh`.
Run the previous command
Run the previous command as root
$ sudo !!
Run a command with the last argument of the previous command
$ [command] !$
Run a command with the first argument of the previous command
$ [command] !^
Run the command n lines back in the history
Run the most recent command starting with string
Run the previous command, replacing string1 with string2
Perform a history expansion, but print the command that would be run instead of actually running it
Copied to clipboard