30
|
Editing Files
Nano (formerly pico)
‘echo ’ is a very useful command if we want to add text to a file, however it cannot be used to modify
an existing file. For this, we have to use a text editor. The two standard text editors in Linux are
‘vim’ and ‘pico ’ (now known as ‘nano’). ‘vim ’ (also known as ‘vi’ (vee-eye))
is a rather hardcore text
editor, which is remarkably non-user-friendly. It is the preferred text editor by the highly experienced
of
console users; however it is very complicated to learn. Feel free to read up on ‘vim’ in your own
time by looking at its ‘man’ page and looking online for help.
For today, we will learn to use ‘pico ’
to modify the contents of a file.
Pico is very much like ‘Notepad’ but without a mouse. All commands are executed through the use
of the keyboard, using the
key modifier. It can be used to edit virtually any kind of text file
from the command line, and is frequently used to configure services after they have been installed.
This is a standard (blank) Pico window, as you will see if you run the command ‘pico ’ from the
command prompt. At the bottom of the screen, there are commands with a ‘^’ symbol in front.
These are the commands that can be used. The ‘^’ shows that you need to hold down the Control
(Ctrl) key, and then press the corresponding letter of the command you wish to use. For Example:
Ctrl+X will exit Pico and return you to the Command Line.