Awesome little script to do bulk rename of files posted on MandrivaUsers.org by Steve Scrimpshire.
#!/usr/bin/perl -w
# rename – Larry’s filename fixer
$op = shift or die “Usage: rename expr [files]\n”;
chomp(@ARGV =) unless @ARGV;
for (@ARGV) {
$was = $_;
eval $op;
die $@ if $@;
rename($was,$_) unless $was eq $_;
}
Create a new file in /usr/bin rename.pl with the above contents.
chmod +x /usr/bin/rename.pl
Now you can do something like this to bulk rename files:
rename.pl ‘s/[0-9]+-//g’ *
This requires some knowledge of Regular Expressions.
bulk rename bash script – MandrivaUsers.org
Browse Timeline
- « Boston College Campus Police: “Using Prompt Commands” May Be a Sign of Criminal Activity | Electronic Frontier Foundation
- » First Mac Botnet Activated, Engages in DDoS Attacks