O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sections

Just Enough to Get By

As the heading suggests, in this section I attempt to present a subset of the vi commands large enough to enable you to accomplish basic tasks, but small enough that a beginner can remember most of them. Note that the topics covered in this section are covered in more detail in other sections.

Opening and Closing

You open a file by typing “vi <filename>” on the command line— for example:

vi chapter29.txt

You close a file by getting into command mode (use the <Esc> key), typing a colon “:” and then typing wq (write quit). If you don't want to save changes to the file, type q (quit). If it gives you any trouble, type wq! (enthusiastic quit).

Inserting Text

You insert new text by getting into edit mode. There are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required