1

When you forgot to sudo a command you may want to write,

sudo !!

That would execute the last command applying the sudo command to it.

However sometimes seems I can't do that, for example inside /etc folders. What am I missing?

EDIT:

dione@saturno:/etc$ echo testing > testfile
bash: testfile: Permiso denegado
dione@saturno:/etc$ sudo !!
sudo echo testing > testfile
bash: testfile: Permiso denegado
dione@saturno:/etc$ 

Now I guess that's because it's doing sudo echo, and the problem is that redirection is not affected.

whitenoisedb
  • 733
  • 4
  • 12
  • 18

0 Answers0