Thursday, February 20, 2014

Add words to file in linux

Following Linux commands can be used to add words to file.

1) open file in Linux vi editor
2) ESC and type following command as you referred

:/s/^/0/g
add zero(0) to in front of each line
^ defines the start of the line

:/s/$/0/g
add zero(0) to end of each line 
$ defines the end of the line

:/s/718/0/g
replace "718" with zero(0)