Uses a vi-like search and replace syntax:
perl -pi -e 's/find this/replace with this/g' /tmp/file.txt
When placed into a
for loop, you get some pretty cool capabilities. For example, find string and replace with nothing:
ls -1 dir/*svg > svg-files
for file in `cat svg-files`; do perl -pi -e ' s/\/home\/richw\/screenshots\/784wide\/dir\///g' $file; done