[最佳答案] There are a few ways to do this. There's a rename program written in Perl: rename 's/\.ext\z/.otherext/' *.ext But there's also another (incompatible) rename program around, for which you'd have to do this: rename .ext .otherext *.ext There's also a program called mmv: mmv '*.ext' '#1.otherext' Using plain bash: for i in *.ext; do mv -- "$i" "${i%.ext}.otherext"; done Using plain perl: perl -we 'for my $old (glob "*.ext") { (my $new = $old) =~ s/\.ext\z/.otherext/;