I\'ve successfully used the following sed
command to search/replace text in Linux:
sed -i \'s/old_link/new_link/g\' *
However,
Sinetris' answer is right, but I use this with find
command to be more specific about what files I want to change. In general this should work (tested on osx /bin/bash
):
find . -name "*.smth" -exec sed -i '' 's/text1/text2/g' {} \;
In general when using sed
without find
in complex projects is less efficient.