To edit content between specific line numbers use following expression in vim editor
In above expression add s after end line number.
Add # character at a starting of the line from line number 3 10 use following expression in vim:
To replace all foo’s with bar’s from line 3 to 10 use following expressin:
We can achieve same functionalities with sed expression also with following expressions:
$ sed -i "3,10s/^/#/g" inputFileName $ sed -i "3,10s/foo/bar/g" inputFileName