Software >> OS >> Unix >> Utilities >> vi >> How to search and replace keywords for whole document

1. syntax :[range]s/pattern/string/[g][c] where range: range to search from eg. 1,$ means from line 1 to last line s: command to substitute g: search all matches c: confirmation 2 example :1,$s/key1/key2/g