.comment-link {margin-left:.6em;}

IntTech

Wednesday, March 26, 2008

Vi search and replace

After 20 years of working on UNIX I am just now finding the need to learn more than the basics of VI. (Yes I have been a emacs person for many many years.) Here is how to do a global search and replace in vi.
 1,$s/oldstring/newstring/g  
The 1 means the first line of the file (obvious) and $ means the last line of the file (less obvious).

Bookmark and Share

0 Comments:

Post a Comment

<< Home


Google