Using !!, you can access the last command executed. Useful for rerunning a command with sudo-privilege.
Example:
$ make_me_a_sandwich
What? Make it yourself
Rerun it using !!
$ sudo !!
$ sudo make_me_a_sandwich
Okay.
Writings | GitHub | LinkedIn Using Example: Rerun it using Access the last command in a shell
!!, you can access the last command executed. Useful for rerunning a command with sudo-privilege.$ make_me_a_sandwich
What? Make it yourself
!!$ sudo !!
$ sudo make_me_a_sandwich
Okay.