
Eu estava tentando usar !!
na minha nova instalação do debian e recebi o seguinte erro:
$ sudo !!
sudo: !!: command not found
Eu ganho uso de !!
?
Além disso, como posso ligar !!
para poder pesquisar algo sobre isso no Google?
Responder1
Você está fazendo referência aohistóriafunção do seu shell quando você se refere a!!
Não tenho certeza de qual shell você está usando. De man bash
:
HISTORY EXPANSION
The shell supports a history expansion feature that is similar to the
history expansion in csh.
...
Event Designators
An event designator is a reference to a command line entry in the his‐
tory list. Unless the reference is absolute, events are relative to
the current position in the history list.
! Start a history substitution, except when followed by a blank,
newline, carriage return, = or ( (when the extglob shell option
is enabled using the shopt builtin).
!n Refer to command line n.
!-n Refer to the current command minus n.
!! Refer to the previous command. This is a synonym for `!-1'.
Existe alguma coisa no seu histórico de shell? Quando você digita o history
comando, você obtém alguma saída?
Não consigo duplicar o erro que você vê:
~$ ls -l | head -1
total 54324
~$ sudo !!
sudo ls -l | head -1
total 54324
~$