You're viewing a comment by Übersetzungsbüro and its responses.

October 21, 2010, 06:28

#3 is great -- I am always trying to edit files in /etc and forgetting to become root or use sudo.

But, based on your explanation, I'm not sure why the following doesn't work:

:w !sudo cat > %

It seems that should also be able to write to the file, but I get a permission error when I try it

:w !sudo cat > %
/bin/bash: /tmp/root.txt: Permission denied

shell returned 1

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "linux_195": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.