How often have you typed in a command and then realized that you forgot to type sudo. This will help you, don/t need to type the long long command.
type the following !! will replace your last command
$ sudo !!
example
$ vi /etc/apt/sources.list
this will open file as read only you need sudo to edit the file
$ sudo !!
this will expand your command automatically to
$ sudo vi /etc/apt/sources.list
2 comments:
really no idea how to do
Very useful indeed, thanks for sharing!
Post a Comment