renaming files or adding a name in the beginning of all files in a folder

Hi All

I have a folder that contains hundreds of file with a names

3.msa
4.msa
21.msa
6.msa
345.msa
456.msa
98.msa
...
...
...

I need rename each of this file by adding "core_" in the begiining of each file such as

core_3.msa
core_4.msa
core_21.msa
core_6.msa
core_345.msa
core_456.msa
core_98.msa

Please let me know the best way to peform this filename change in a folder.

LA

shopt -s nullglob
for f in *.msa
do
  echo mv "$f" "core_${f}"
done



Thanks, but it is not working. It just writes mv commands but not executing. Let me know what might have occurred

if the code is successful, remove the echo from it.

for i in `ls *.msa`
do
  mv $i core_$i
done