2 Add remark that the OP can remove the echo when the resulting lines are fine
source | link

Try:

for f in ./file1.*; do
  echo mv "$f" "newfile.${f##*.}"
done

The code only displays what the mv commands will be. When this is what you want, remove the echo in front of the mv command.

Try:

for f in ./file1.*; do
  echo mv "$f" "newfile.${f##*.}"
done

Try:

for f in ./file1.*; do
  echo mv "$f" "newfile.${f##*.}"
done

The code only displays what the mv commands will be. When this is what you want, remove the echo in front of the mv command.

1
source | link

Try:

for f in ./file1.*; do
  echo mv "$f" "newfile.${f##*.}"
done