I saw the command
in a video.
What does this mean?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
From the bash manual:
9.3.1 Event Designators
!!- Refer to the previous command. This is a synonym for ‘!-1’.
And from the
sudo man page:
sudoallows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file.
sudo !! means to execute the previous command as the superuser.
The double exclamation point "!!" is used to recall the last line entered into a shell.
sudo is shorthand for "Super User DO" and is used when you want to execute a function with super user privileges.
So if I executed
but then remembered I needed super user privelages, one could simply type
rather than typing
sudo ./foobar all the way out. This is particularly useful when your last command was on the order of dozens of characters.