In order to edit files on the command line you will have to use a text editor.

There are many text editors for linux the most popular ones are vim and nano.

Vim is very powerful but hard to learn editor, for more info see - http://newbiedoc.sourceforge.net/text_editing/vim.html

nano is an easier editor - to edit a file type (as example)

nano [filename]

i.e :-

nano /etc/Apache2/Apache2.conf


Once you have made the change you can save using CTRL + x (then choose y)

For more nano info see - http://www.nano-editor.org/docs.php

If your server does not come with either of these editors installed you can install them by using the package manager (see the package installation section for more details) - i.e:

apt-get install vim