Recursively changing text with sed

Recently, I wanted to change all occurrences of an RGB hex code throughout a WordPress website I put up. The theme I chose had a limited set of color schemes and I wanted to use a particular color. Rather than hunt down each occurrence, I logged into the server and ran this command:

cd /var/www/
find . -type f -print0 | xargs -0 sed -i 's/27cbcd/002664/g'

(To change occurrence of the RGB code 26cccc with 000066)

Leave a Comment