When in vi, press <shift> <:> together to get a : prompt at the bottom of the screen, then just wq <filename> (or wq if the file already existed and is just being edited) to save and exit vi. Hope this helps.
:w - save changes
:w 'filename' - save to 'filename'
:wq - save changes and quit vi
:wq! - save changes to a read-only file and quit vi
:q - quit vi
:q! - quit vi and don't save any changes
Make sure that you are not in 'Insert' mode when you enter : (Shift + .
ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.