Saturday, 11 August 2007

Vi Search and Replace

Sometimes when working with Linux cli, you have to edit files and make bulk changes to configuration files.

I use vi as a text editor and I thought I'd add this example fo search and replace using vi;


In the above example, 1 represents the first line, $s represents the end line.

One important thing to note is that you need to escape any characters like dots, for example;


would be the way you change domain names from to

No comments: