Here is a cool trick to enable you to edit text files in Terminal using a little applications called pico. Its really easy and the text editor is quite powerful. It is really simple to do and can open every file that you can open in text edit.
To enable yo to do this trick open up Terminal (Applications > Utilities > Terminal) on a new line type.
Give it a second or two and a text editor will open. As shown in the image below.
You can then edit then proceed to edit the text using the commands below. You can read through the help file associated if you need more help. By the way most commands are accessed through ctrl and a represented though the up arrow (^).