Wednesday, 2 January 2013

Linux - read only statement while saving protected files in vi


vi editor on Ubuntu operating system


Read only statement prohibiting you from saving all your changes and therefore committing you to dumping them and trying again with sudo.


Use the following command inside vi
:w !sudo tee %

You can also save your file into a temporary location
:wq /tmp/myfile

No comments:

Post a Comment