====== Replace strings in multiple files using find and sed ====== This simple command line uses the standard unix tools 'find' and 'sed' to replace occurrences of word1 by word2 and word3 by word4 in all .h and .c files in the current directory and its sub-directories. ===== Find and replace using find/sed ===== find . -name "*.[h|c]" | xargs -I% sed -i -e "s:word1:word2:g" -e "s:word3:word4:g" % {{tag>unix howto}} ~~DISCUSSION~~