If you want to recursively replace a string in all files in a directory, you first go to StackOverflow, find the relevant find | xargs (sed or awk) command and then wrestle with it until it works.
How about no?
Just do `sudo apt-get install rpl`. It's a tool to do this exact thing very conveniently.
https://github.com/rrthomas/rpl