Commands Used To Start, Exit, Read, and Write Files in Vi: Linux Foundation
Commands Used To Start, Exit, Read, and Write Files in Vi: Linux Foundation
Commands Used To Start, Exit, Read, and Write Files in Vi: Linux Foundation
Command Usage
:q<ret> Quit vi
Keys Usage
Introduction to Linux 1 of 3
w To move to beginning of next word
Command Usage
/pattern<ret> Search forward for pattern
?string<ret> Search backward for pattern
Key Usage
n Move to next occurrence of search pattern
N Move to previous occurrence of search pattern
Key Usage
a Append text after cursor; stop upon Escape key
A Append text at end of current line; stop upon
Escape key
i Insert text before cursor; stop upon Escape key
I Insert text at beginning of current line; stop upon
Escape key
o Start a new line below current line, insert text there;
stop upon Escape key
O Start a new line above current line, insert text
there; stop upon Escape key
r Replace character at current position
Introduction to Linux 2 of 3
R Replace text starting with current position; stop
upon Escape key
x Delete character at current position
Nx Delete N characters, starting at current position
dw Delete the word at the current position
D Delete the rest of the current line
dd Delete the current line
Ndd or dNd Delete N lines
u Undo the previous operation
yy Yank (copy) the current line and put it in buffer
Nyy or yNy Yank (copy) N lines and put it in buffer
p Paste at the current position the yanked line or lines
from the buffer
Introduction to Linux 3 of 3