Example: Replace every instance of yourdomain with mydomain in all .html files in current path using Perl. perl -pi -e "s/yourdomain/mydomain/g;" *.html Same as above but make a copy of original file for backup. perl -pi -e.bak "s/yourdomain/mydomain/g