Thursday, August 12, 2021

Using vi, the Unix Visual Editor

(Anhgolden's Blog) - Using vi, the Unix Visual Editor

Edit file
#vi [filename].txt

Insert (or text) mode
<Esc>

Exiting
:wq    Write, then quit
:q!      Quit without saving changes to file

Coping and Pasting text
yy     Copy (yank) the current line 

6yy   Copy (yank) six lines, beginning with the current line 

yw    Copy the current word 

p       Put the text after the cursor position 

P       Put the text before the cursor position


No comments:

Post a Comment