10, Linux command commonly used command -VI

VI line mode:

: set nu // display line numbers
: set nonu // do not display line numbers
: n // jump refers to the n-th row
: w file // Save as
: n1, n2 s / string1 / string2 / g // from n1 row to N2 string1 replaced rows of string2
:% S / string1 / string2 / G // all rows string1 replace string2,% represents all rows, g represents all string1 words
:% s + / usr / local / bin + / usr / bin + g // alternative characters contain "/" is, instead of using + /
: WQ // save and exit
: q // forced to exit without saving!

VI Command Mode:

The last line G //
gg // a first line
dd // delete rows
u // undo
yy // Copy line
nyy // Copy n lines
p // Paste

Guess you like

Origin www.cnblogs.com/zengfh/p/12286552.html