Author: tom

Search and replace in vi (or sed)

Search and replace in vi is both quick and simple:X,Ys/search/replace/g (where x – start line number, y – end line number. optional) One very useful feature is the ability to use parts of the search regular expression within the replace string. For example, where the selected lines contain values between 2000-2999 and all these values