Using the vi Text Editor
It??™s almost impossible to use Linux for any period of time and not need to use a text editor. This is
because most Linux configuration files are plain text files that you will almost certainly need to
change manually at some point.
If you are using a GUI, you can run gedit, which is fairly intuitive for editing text. There??™s also a
simple text editor you can run from the shell called nano. However, most Linux shell users will
use either vi or emacs to edit text files. The advantage of vi or emacs over a graphical editor is
that you can use it from any shell, a character terminal, or a character-based connection over a
NOTE
CAUTION
74
Linux First Steps Part I
network (using telnet or ssh, for example)??”no GUI is required. They also each contain tons of
features, so you can continue to grow with them.
This section provides a brief tutorial on the vi text editor, which you can use to manually edit a
configuration file from any shell. (If vi doesn??™t suit you, see the sidebar ???Exploring Other Text
Editors??? for other options.)
The vi editor is difficult to learn at first, but once you know it, you never have to use a mouse or a
function key??”you can edit and move around quickly and efficiently within files just by using the
keyboard.
Pages:
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235