Basic Text Editing Using vi
Fedora Core, like most other Linux and Unix systems, stores most of its configuration information in text files. These files can be edited using various system administration tools, but they can also be edited by hand using any standard text editor.
vi is one such text editor. Some people love it, and some people hate it, but it has one advantage over just about every other editor available: it’s universal. If you know how to use vi, you can confidently walk up to just about any Linux or Unix computer in the world and edit text files, so it’s a valuable skill. The other nice fact about Vi is that it’s not very demanding; you can use it in character mode or graphic mode, over a congested remote connection or with a foreign keyboard, and still get the job done. You can get by with less than a dozen commands to start, and then learn more when you need them.
Tip
vi is pronounced “vee-eye,” not “vye” or “six.”
How Do I Do That?
To start up the vi editor, simply type its name at a shell prompt, optionally providing the name of a file you wish to edit as an argument:
$vifilename
The screen will clear, and the specified file will be displayed, as shown in Figure 4-4.

Figure 4-4. Initial vi display
Notice that unused lines are marked with a tilde (~) character.
vi modes
vi uses two distinct modes:
Normal mode, where the text keys issue editing commands. This is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access