Getting root permissions on a file inside of vi? [closed]

Often while editing config files, I’ll open one with vi and then when I go to save it realize that I didn’t type

sudo vi filename

Is there any way to give vi sudo privileges to save the file? I seem to recall seeing something about this while looking up some stuff about vi a while ago, but now I can’t find it.

10 Answers
10

Leave a Comment