Skip to content
Advertisement

find and replace a String in vi editor on linux?

i am trying to replace String with new String in Linux vi editor

JavaScript

but getting following error.

JavaScript

Advertisement

Answer

I’d guess the reason you’re getting that error message is because you intend to replace the string on all lines, not just the current one. In order to search all lines, add a % to your command:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement