Using sed and grep/egrep to search and replace
Use this command: egrep -lRZ “\.jpg|\.png|\.gif” . \ | xargs -0 -l sed -i -e ‘s/\.jpg\|\.gif\|\.png/.bmp/g’ egrep: find matching lines using extended regular expressions -l: only list matching filenames -R: search recursively through all given directories -Z: use \0 as record separator “\.jpg|\.png|\.gif”: match one of the strings “.jpg”, “.gif” or “.png” .: start the … Read more