Global substitution of VI commands


Global substitution of VI commands

WeChat public address:51 yards of rural network
Professional programming Q & a community

First open the file you want to operate with the VI command, and then enter:% s / line / line / g
Explain the function of this command:
: used to start an ex command
%Determines the scope of the action, from line 1 to the last line of the file. If you do not enter%, the command will only take effect on the current line. You can also enter specific line numbers 1, 5.
S means this is a replacement operation
/Line / line search and replace text
G represents global, that is, to replace every instance of every row searched. If G is missing, only the first instance of every row that meets the conditions will be replaced

Recommended Today

Gupao phase III advanced development of Java Java advanced large scale Internet Architects

Gupao phase III advanced Java development Micro cloud link:Link: Password: m4xy7s Baidu disk: link: Password: 1bpw In case of failure, contact wechat: itit11223344     Opening ceremony of Java architecture class[playback] opening ceremony of Java architecture class (20:00-21:30, February 19) 02The design principle of architect’s internal mental skill[playback] Why study software architecture design […]