Common Vi Commands


All Linux configuration files are written in plain English, easy to read and to adapt. You use a text-editor to write or make changes to such files. The two most popular, powerful, and unfortunately “difficult” text editors, both of which are found in every Linux are Vi and Emacs.

Most GUI-based editors, such as Kedit, are easier to manage. But don’t make the mistake of thinking that a GUI-based editor is all you need. There are situations that crop up with Linux that require a text-mode editor –in other words, when you don’t have the luxury of accessing a GUI desktop at all. Vi and Emacs are the only tools that come with every Linux that work in text mode, so learning one or the other is mandatory.

Press Key(s):* Function:
I Insert text before the cursor
A Insert text after the cursor
: Switch to ex mode
$ Go to last place on the line
^ Go to first place on the line
W Next word
B Previous word
Shift-G Last line of the file
20 Shift-G Go to line 20
Y Copy. (Note: Y3W = copy 3 words; Y3J = copy 4 lines.)
P Paste
D Cut
X Delete character under the cursor


Please enter your comment!
Please enter your name here