Search and replace in multiple files
If you ever need to search and replace strings throughout a bunch of files here’s a neat, somewhat alternative, way to do it. for file in `ls **/*.txt`;do perl -pi -w -e ‘s/SEARCH_FOR_THIS/REPLACE_WITH_THIS/g;’ $file; done The nested ‘perl’ command can work kind of like ‘sed’. Here are what the arguments being passed in mean: -e [...]