Using the Text Editors

Linux distributions include a number of applications known as text editors that you can use to create text files or edit system configuration files. Text editors are similar to word processing programs, but generally have fewer features, work only with text files, and might or might not support spell checking or formatting. The text editors range in features and ease of use, but are found on nearly every Linux distribution. The number of editors installed on your system depends on what software packages you've installed on the system.

Some of the console-based text editors are

• ed A simple line editor without cursor support

• emacs The comprehensive GNU emacs editing environment, which is much more than an editor; see the section "Working with emacs" later in this chapter

• jed A programmer's text editor with features such as colorized highlighting of text to help syntax checking and editing of programs

• joe Joe's Own Editor, a text editor, which can be used to emulate other editors

• mcedit A DOS-like text editor for UNIX-like systems

• nano A simple text editor similar to the pico text editor included with the pine email program

• sed A stream editor usually used in shell scripts (discussed in Chapter 15)

• vim An improved, compatible version of the vi text editor (which we will call vi in the rest of this chapter because it has a symbolic link named vi and a symbolically linked manual page)

Note that not all text editors described here are screen-oriented; editors such as ed and sed work on a line-by-line basis, or a stream of text, and do not support movement of a cursor on the screen. Some of the text editors for the X Window System, which provide a graphical interface, such as menu bars, buttons, scrollbars, and so on, are

• gedit A GUI text editor for GNOME

• kate A simple KDE text editor

• kedit A simple KDE text editor

• nedit A programming text editor

• kwrite A simple KDE text editor

A good reason to learn how to use a text-based editor, such as vi, is that system maintenance and recovery operations generally never take place during X Window sessions (negating the use of a GUI

editor). Many larger, more complex and capable editors will not work when Linux is booted to its single-user or maintenance mode. See Chapter 15 for more information about how Ubuntu boots. If anything does go wrong with your system, you probably won't be able to get into the X Window system, making knowledge and experience of using both the command line and text editors such as vi important. Make a point of opening some of the editors and playing around with them; you never know, you might just thank me someday!

Another reason to learn how to use a text-based editor under the Linux console mode is that you will be able to edit text files through dial-up or network shell sessions because many servers do not host graphical desktops.

Was this article helpful?

0 0

Post a comment