Reply
Need help Saving an edit to a file in SSH
Old 09-26-2007, 12:55 AM Need help Saving an edit to a file in SSH
Skilled Talker

Posts: 79
Location: Norfolk, Va
I am trying to install mod_layout on my server, I need to edit the file to do this, i figured out how to edit it but to save it, everywhere says press ctl+x but when I do that it doesn't save it brings up a bunch of options each of which I tried and none of which save the file. Mostly it seems like a bunch of find commands. I scoured the internet for an answer but have come up with none so far. Anyone know what I am talking about?
aswen001 is offline
Reply With Quote
View Public Profile Visit aswen001's homepage!
 
When You Register, These Ads Go Away!
Old 09-26-2007, 04:45 AM Re: Need help Saving an edit to a file in SSH
tripy's Avatar
Fetchez la vache!

Posts: 2,251
Name: Thierry
Location: In the void
ctrl+x ?
Probably you are using nano...

Well, simply, once you have modified your file, press ctrl+x.
It will ask you if you want to save your file (look in the white bar at the bottom).
Quote:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
Y Yes
N No ^C Cancel
Simply press "y", and it will ask you under what name to save the file. By default, the current file name. Simply press enter, and you are done
Quote:
File Name to Write: df.txt
^G Get Help
N No ^C Cancel
The ^ is the "control" key, fyi.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 09-26-2007, 11:40 AM Re: Need help Saving an edit to a file in SSH
Skilled Talker

Posts: 79
Location: Norfolk, Va
Unfortunatley I am not using nano. The server only has vi. and after control X it bring up ^E,^Y,^D,^L,etc. not neccesarily in that order. and control Y after the control X doesn't seem to save. Any other sugggestions? Or am I just doing something horribly wrong?
aswen001 is offline
Reply With Quote
View Public Profile Visit aswen001's homepage!
 
Old 09-26-2007, 12:02 PM Re: Need help Saving an edit to a file in SSH
tripy's Avatar
Fetchez la vache!

Posts: 2,251
Name: Thierry
Location: In the void
Ok, much easier for me then.

In Vi, you start in command mode.
Put your cursor where you want to do the edit, and press "i" to get into edit mode.
Make your changes, and press "esc" to get back in command mode.

Do every changes you want, and when you are done, get in command mode and do:
Quote:
:w [enter]
to save your file, and
Quote:
:q [enter]
to quit vi.



A quick reference commands (always to type in command mode, and case sensitive):
Quote:

17G [enter] => go to the line nbr 17
/any [enter] => search for the word "any"
:u [enter] => undo
dd [enter] => delete the line under the cursor
G [enter] => goes to the last line of the file
__________________
Listen to the ducky: "This is awesome!!!"


Last edited by tripy : 09-26-2007 at 12:05 PM.
tripy is offline
Reply With Quote
View Public Profile
 
Old 09-26-2007, 01:35 PM Re: Need help Saving an edit to a file in SSH
Ultra Talker

Posts: 484
Oh vi! For my entire first year at university we were only given access to vi... our lecturer's theory was that if you can use vi, you can use anything and if there's only going to be one editor somewhere, that will be it.

I hated him for making us use that... for about 2 weeks then it was very hard to get me off it
__________________
Free PHP Obfuscator
TwistMyArm is offline
Reply With Quote
View Public Profile
 
Old 09-26-2007, 02:44 PM Re: Need help Saving an edit to a file in SSH
Skilled Talker

Posts: 79
Location: Norfolk, Va
Helpful hint for Mac users that I figured out finally.
ESC does not end instert but ^S does.
Thanks for everone's help I go it squared away now
aswen001 is offline
Reply With Quote
View Public Profile Visit aswen001's homepage!
 
Reply     « Reply to Need help Saving an edit to a file in SSH
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13846 seconds with 12 queries