search and replace in vi

| May 8, 2011 | 0 Comments

How to seach and replace in Linux using Vi editor.

:%s/word/replacement/gi

i — > denotes all words without case sensitive
g– > all matching words

OR

:w file /* save to file */
:10,15w file /* save lines to file*/

Tags: , ,

Category: Linux Administration

Leave a Reply

You must be logged in to post a comment.