Linux Replace a string with another in vi editor August 9, 2012 Pramod T P :%s/str1/$str2/g will replace all the occurance of str1 with str2