Which Text Editor ?
Contents
Introduction
There are many Text Editors that you can use with Unix and really it’s a matter of preference as to which you use. So we’re just going to cover the basics.
If you prefer to use another text editor other than Vi then in these documents where you see vi /path/to/config/file just replace vi with favourite text editor, such as nano /path/to/config/file or pico /path/to/config/file.
Vi
Vi comes with installation; it has many features allowing you to a lot. However for these documents you only need to know the basics, so for a more extensive guide to the commands of Vi please check out http://en.wikipedia.org/wiki/Vi#EX_commands_in_vi
To open a Document in Vi
[root@vps ~]# vi /usr/share/doc/centos-release-4/GPL
Once Vi is open it will look like this.

You can navigate through the document using your keyboard arrows keys, home, end, page up and down keys as well.
To save the document just press shift and the colon/semi colon button so you get a colon ":" and then the w and shift and 1 key to get an explanation mark "!" , so what you have looks like :w! then press the enter key to finish.

Once the document is saved, you will see the document path and document file followed by some numbers and letters and on the end written
e.g. "/usr/share/doc/centos-release-4/GPL" 347L 1867C written" at the bottom of the screen.

To quit Vi :q (colon q) and you will be returned to your command prompt.

Nano (Centos) / Pico (Debian)
Nano is a clone of Pico and they both look and work the same as each other.
To install Nano on Centos
[root@vps ~]# yum install nano
To install Pico on Debian
[root@vps ~]# apt-get install pico
To open a document in nano and pico
[root@vps ~]# nano /usr/share/doc/centos-release-4/GPL [root@vps ~]# pico /usr/share/doc/centos-release-4/GPL
Once nano is open it will look like this.

You can navigate through the document using your keyboard arrows keys, home, end, page up and down keys as well.
To save the document just press CTRL+O
A box will apear to give you the chance to change the filename, unless you need to change the name just press Enter.

When the document is saved, it will say [ Wrote x lines ] in this change [ Wrote 347 lines]

Finally to quit, just press CTRL+X and you will be returned to the command prompt.
- Login to post comments
