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" %


Labels: , Wireless Internet Security Coding Network Monitoring

Comment

Enter your comment (wiki syntax is allowed):
SWUVQ

Wireless Internet Security Performance RADIUS server Wireless Internet Security Performance RADIUS server