You can do something like this:
extension="${file##*.}"
filename="${file%.*}"
mv "$file" "${filename}001.${extension}"
You can find more detailed information about these commands in the excellent answer to Extract file name and extension in bash .
Test
$ ls hello.*
hello.doc hello.txt
Rename these files:
$ for file in hello*; do ext="${file##*.}"; filename="${file%.*}"; mv "$file" "${filename}001.${ext}"; done
Tachan ...
$ ls hello*
hello001.doc hello001.txt
source
share