how to save terminal files that you opened with “$ sudo vi” [duplicate]












0
















This question already has an answer here:




  • How do I save files edited with vim?

    4 answers




I am currently following a tutorial that asked to open a file with "sudo vi /..."
first and formost I have half an understanding of how to type but I managed and now I need to save the file but how do I do that? I tried to use ctrl x but that doesnt work and there is no other means in the file/ edit section of the terminal. Please help.



kind regards
coolxm










share|improve this question













marked as duplicate by Kulfy, user535733, Eric Carvalho, Xen2050, karel Jan 26 at 23:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 1





    I'm no vi expert, but I think it's Press esc, then w (to write) and q (to quit) You should probably examine vi tutorials, such as http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

    – Charles Green
    Jan 26 at 17:24











  • Closely related: How do I save files edited with vim?

    – steeldriver
    Jan 26 at 18:41











  • Why not use a more friendly editor instead, like nano?

    – Xen2050
    Jan 26 at 22:38
















0
















This question already has an answer here:




  • How do I save files edited with vim?

    4 answers




I am currently following a tutorial that asked to open a file with "sudo vi /..."
first and formost I have half an understanding of how to type but I managed and now I need to save the file but how do I do that? I tried to use ctrl x but that doesnt work and there is no other means in the file/ edit section of the terminal. Please help.



kind regards
coolxm










share|improve this question













marked as duplicate by Kulfy, user535733, Eric Carvalho, Xen2050, karel Jan 26 at 23:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 1





    I'm no vi expert, but I think it's Press esc, then w (to write) and q (to quit) You should probably examine vi tutorials, such as http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

    – Charles Green
    Jan 26 at 17:24











  • Closely related: How do I save files edited with vim?

    – steeldriver
    Jan 26 at 18:41











  • Why not use a more friendly editor instead, like nano?

    – Xen2050
    Jan 26 at 22:38














0












0








0









This question already has an answer here:




  • How do I save files edited with vim?

    4 answers




I am currently following a tutorial that asked to open a file with "sudo vi /..."
first and formost I have half an understanding of how to type but I managed and now I need to save the file but how do I do that? I tried to use ctrl x but that doesnt work and there is no other means in the file/ edit section of the terminal. Please help.



kind regards
coolxm










share|improve this question















This question already has an answer here:




  • How do I save files edited with vim?

    4 answers




I am currently following a tutorial that asked to open a file with "sudo vi /..."
first and formost I have half an understanding of how to type but I managed and now I need to save the file but how do I do that? I tried to use ctrl x but that doesnt work and there is no other means in the file/ edit section of the terminal. Please help.



kind regards
coolxm





This question already has an answer here:




  • How do I save files edited with vim?

    4 answers








editor vi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 26 at 17:19









Genesis Of GamingGenesis Of Gaming

1




1




marked as duplicate by Kulfy, user535733, Eric Carvalho, Xen2050, karel Jan 26 at 23:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Kulfy, user535733, Eric Carvalho, Xen2050, karel Jan 26 at 23:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1





    I'm no vi expert, but I think it's Press esc, then w (to write) and q (to quit) You should probably examine vi tutorials, such as http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

    – Charles Green
    Jan 26 at 17:24











  • Closely related: How do I save files edited with vim?

    – steeldriver
    Jan 26 at 18:41











  • Why not use a more friendly editor instead, like nano?

    – Xen2050
    Jan 26 at 22:38














  • 1





    I'm no vi expert, but I think it's Press esc, then w (to write) and q (to quit) You should probably examine vi tutorials, such as http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

    – Charles Green
    Jan 26 at 17:24











  • Closely related: How do I save files edited with vim?

    – steeldriver
    Jan 26 at 18:41











  • Why not use a more friendly editor instead, like nano?

    – Xen2050
    Jan 26 at 22:38








1




1





I'm no vi expert, but I think it's Press esc, then w (to write) and q (to quit) You should probably examine vi tutorials, such as http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

– Charles Green
Jan 26 at 17:24





I'm no vi expert, but I think it's Press esc, then w (to write) and q (to quit) You should probably examine vi tutorials, such as http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

– Charles Green
Jan 26 at 17:24













Closely related: How do I save files edited with vim?

– steeldriver
Jan 26 at 18:41





Closely related: How do I save files edited with vim?

– steeldriver
Jan 26 at 18:41













Why not use a more friendly editor instead, like nano?

– Xen2050
Jan 26 at 22:38





Why not use a more friendly editor instead, like nano?

– Xen2050
Jan 26 at 22:38










1 Answer
1






active

oldest

votes


















1














To save, press:



:w



That is, the 'colon' key, then the 'w' key. Then the enter key.



To save and quit, hold the shift key, and hit 'z' twice.



To quit without saving, hit:



:q!



Then the enter key.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    To save, press:



    :w



    That is, the 'colon' key, then the 'w' key. Then the enter key.



    To save and quit, hold the shift key, and hit 'z' twice.



    To quit without saving, hit:



    :q!



    Then the enter key.






    share|improve this answer




























      1














      To save, press:



      :w



      That is, the 'colon' key, then the 'w' key. Then the enter key.



      To save and quit, hold the shift key, and hit 'z' twice.



      To quit without saving, hit:



      :q!



      Then the enter key.






      share|improve this answer


























        1












        1








        1







        To save, press:



        :w



        That is, the 'colon' key, then the 'w' key. Then the enter key.



        To save and quit, hold the shift key, and hit 'z' twice.



        To quit without saving, hit:



        :q!



        Then the enter key.






        share|improve this answer













        To save, press:



        :w



        That is, the 'colon' key, then the 'w' key. Then the enter key.



        To save and quit, hold the shift key, and hit 'z' twice.



        To quit without saving, hit:



        :q!



        Then the enter key.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 26 at 17:33









        s. wolfes. wolfe

        314




        314















            Popular posts from this blog

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            File:DeusFollowingSea.jpg