Perl Oneliner: rename files in directory recursively

Here is a very simple but efficient solution inspired by this article:

find  | grep IMDB | Perl -ne 'chomp; next unless -e; $orig = $_; $move = 0; if (s/imdb_13/imdb13/) { print "move $orig to $_ ...\n"; system "mv $orig $_"; }'

Leave a Reply

Your email address will not be published. Required fields are marked *

Get Adobe Flash player