Datasheet
Task 1.5: Edit Files
25
If you’re not sure what mode Vi is in, press the Esc key. This will return you
to command mode, from which you can re-enter insert mode, if necessary.
Unfortunately, terminology surrounding Vi modes is inconsistent at best. Command mode
is sometimes referred to as normal mode, and insert mode is sometimes called edit mode
or entry mode, for instance. Ex mode is often not described as a mode at all, but as colon
commands.
Basic Text-Editing Procedures
In this task, the lilo.conf entry for your kernel has been accidentally deleted, so you must
re-create this entry. Listing 1.1 shows the original lilo.conf file used in this example. If
you’re using a lilo.conf file from your computer or that you found on the Internet, it isn’t
likely to be identical, so you may need to adapt some of the details in the following procedure
in minor ways. Alternatively, you can type Listing 1.1 using a text editor with which you’re
already familiar and save it to a file on your disk.
Listing 1.1: Sample /etc/lilo.conf File
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
default=linux
timeout=50
image=/boot/vmlinuz
label=linux
root=/dev/sda6
read-only
Don’t try editing your real /etc/lilo.conf file as a learning exercise; a mis-
take could render your system unbootable the next time you type lilo. You
might put your test lilo.conf file in your home directory for this exercise.
The first step to using Vi is to launch it and have it load the file. In this example, type vi
lilo.conf while in the directory holding the file. The result should resemble Figure 1.2,
which shows Vi running in a Konsole window. The tildes (~) down the left side of the display
indicate the end of the file. The bottom line shows the status of the last command—an implicit
file load command because you specified a filename when launching the program.
83484.book Page 25 Monday, September 18, 2006 8:58 AM










