Programmers are lazy creatures. Any given programmer would love get things done with lesser keystrokes. For instance, find and replace all in multiple files. I was setting up a project on my localhost that some other guy had done. That guy wasn’t a real programmer otherwise what I did would have not been required at first place. The great soul hard-coded all the hyperlinks. What now? I thought of firing an editor and doing a find and replace all by creating a project. Simple. No. I can use grep/egrep to find things then obviously I can chain it to some other command and replace that text. Yes. I am lazy, so instead of experimenting I did some googling. Here is how to do this. Find all files, recursively of course, in current working directory that contain “teh” and replace them with “the”.
egrep -lRZ "teh" ./ | xargs -0 -l sed -i -e 's/teh/the/g'
egrep/grep takes further arguments like type of files to look for, example egrep “teh” *.txt ./ will search for all text files in current working direcotry that contain “teh”. Cool!
So, you can safely say, I can haz teh Linux power!

















