Monday, November 9, 2015

How to append text at beginning and at end of each line in vi (unix)

Go to top of line with :0

Append text to the end of each line, globally:
:%s/$/text/g

Add text to the beginning of each line, globally:
:%s/^/text/g

No comments:

Post a Comment