run same code with changing file name command line code example
Example: change all file to another
for f in *.txt; do
mv -- "$f" "$(basename -- "$f" .txt).text"
done
for f in *.txt; do
mv -- "$f" "$(basename -- "$f" .txt).text"
done