Change only the extension of a file

Use globbing to get the filenames:

for file in Task1/*; do mv ...; done

For precision, only match the files ending in .PDF:

for file in Task1/*.PDF; do mv ...; done

More precise, make sure we are dealing with files, not directories:

for file in Task1/*.PDF; do [ -f "$file" ] && mv ...; done

As a side note, your parameter expansion pattern is fine.


Aside from basic shell commands, on most Lunux distributions there is a nice tool rename that can do the job of renaming multiple files in single command:

rename 's/PDF/pdf/' Task1/*

Here is a nice article about it: Rename – A Command Line Tool For Renaming Multiple Files in Linux.