To search and replace a string globally in the vi editor, use the following syntax: :%s/search_string/replacement_string/g Regular ExpressionUNIX/Linux By KoenJuly 18, 2011Regular Expression, UNIX/LinuxLeave a Comment on Global substitute in vi