linux command intro2 vi

vi

cusor :

0 : to the beginning of the current line

$ : to the end of the current line

G : to the last of the file

gg :   to the beginning of the file

Delete:

dd : delete the current line

dG :from the current line to the end of the file

d20G: from the current line tot the 20th line of the file

d$ :From the current cursor location to the end of the current line

d : also used to cut data

y : use to copy data

p : used to paste data

yy: copy the current line

:%s/Line/line/g

%  Specifies the range of lines for the operation. %is a shortcut
meaning from the first line to the last line.

s  Specifies the operation—in this case, substitution (search and
replace).

/Line/line/ The search pattern and the replacement text.

g  This means global

原文地址:https://www.cnblogs.com/huaxiaoyao/p/4733236.html