Software >> OS >> Unix >> Utilities >> vi >> how to insert a string at beginning of each line

In command mode,

:1,$s/^/newstring/

or

:%s/^/newstring/