Removing part of a filename for multiple files on Linux
First of all use 'sed -e' instead of '\e'
And I would suggest you do it this way in bash
for filename in *.fasta; do
[ -f "$filename" ] || continue
mv "$filename" "${filename//test.extra/}"
done
Try rename "extra.test" "" *
Or rename 's/extra.test//;' *
$ find
./extra.test-eggs.txt
./extra.testbar
./fooextra.test
./ham-extra.test-blah
$ rename "extra.test" "" *
$ find
./-eggs.txt
./bar
./foo
./ham--blah