Inside different htm.gz, html.gz and php.gz web files I have images and the ones in .jpg format have name with space instead of -, but in /images/ directory where all images are located they have - instead of space In html file I have <img class=photo width=400 height=600 src=/images/red roses in summer 54.jpg alt=>And in directory /images/ all are listed fine with - between words like this red-roses-in-summer-54.jpgSo, what I want is a bash command/script that searches in all htm.gz, html.gz and php.gz files inside /var/www/domain.com and find all .jpg images and replace space with -. So from /images/red roses in summer 54.jpg to have /images/red-roses-in-summer-54.jpgServer is running on centos 7 if it's important.
Rename all spaces in image file names inside html php files
bash;shell script;text processing;rename;html