I made lengthy changes to a configuration file on a Ubuntu Linux computer with the vi editor. Unfortunately, I forgot to sudo first, so now I'm in the editor, but can't save my changes because of missing rights. Can I retroactively sudo the user on that terminal, or what would be the best course of action to take?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
In this case, I wrote file with :w /tmp/tmpfile. Then I go out and move /tmp/tmpfile to my old file with sudo rights. That's it ! |
|||
|
|
Couldn't you open another terminal and temporarily change the file's access rights? |
|||||
|