Computing.Net > Forums > Solaris > How to exit vi??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to exit vi??

Reply to Message Icon

Name: wolf60s
Date: August 19, 2002 at 19:29:11 Pacific
Comment:

Hi, I often hit a problem to exit vi when it won't let me write or modify due to without write permission. For example I need use vi to edit a file XYZ, and I forgot to chmod from 555 to 777 before edit. I typed vi XYZ and made some changes, and then I type ^:x and obiviously it won't let me save and exit. But I type ^:q, ctl-c, or ctl-s, and none of cmds let me exit vi. It hangs. I have to kill the session by close the window session. How to solve the problem? Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Dave
Date: August 19, 2002 at 21:08:48 Pacific
Reply:

Have you tried ^:q! (including the exclamation point after 'q')?


0

Response Number 2
Name: James
Date: August 20, 2002 at 04:03:05 Pacific
Reply:

If you want to change permissions before exiting vi, try;

:!chmod u+w %

(Gives user write permssions to current file)

Then try:

:w!

That forces the write (as vi thinks the file is still read-only). Or :x! to write and quit.

As Dave says above, use :q! if you want to force a quit.

The reason why it stops responding is Ctl-S suspends the process. To unsuspend, press Ctl-Q.

James


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


IPSec failing Solaris server migration



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Solaris Forum Home


Sponsored links

Ads by Google


Results for: How to exit vi??

How to exit the console ? www.computing.net/answers/solaris/how-to-exit-the-console-/1875.html

Script to dectect vi /etc/host file www.computing.net/answers/solaris/script-to-dectect-vi-etchost-file/2853.html

How to configure mouse keys for cut/past www.computing.net/answers/solaris/how-to-configure-mouse-keys-for-cutpast/291.html