Dot Rose

Perl Stuff

Note: Examples use single quotes. On Windows systems, use double quotes.

Replace <old text> (a regex pattern) with <new text> in all html files in current directory. Ignore case.

$ perl -pi -e 's/<old text>/<new text>/gi' *.html

Here's one that changes file names from "photo-??.tif" to "photo_2_??.tif" (where ?? are two digits). Enter all on one line.

$ perl -e 'for (@ARGV) { rename($_, $n) if ( $n=$_) =~ 
s/photo-(\d\d)\.tif/photo_2_$1.tif/e )' *.tif