Useful shortcuts for vi editor

Sunday 19 October 2014

How to change a specified string inside all files by recursively?

Only run this command in terminal;

$ find . -type f -exec sed -i 's/'old'/'new'/g' {} \;

You can also use escape character to use '/'.

$ find . -type f -exec sed -i 's/'\\/old'/'\\/new'/g' {} \;
(\\ -> escape characters)