How do I quickly rename the file extensions?

If you’re on Linux console, just run the following command inside the directory in which you have the files.

for i in *.JPG; do mv $i `basename $i .JPG`.jpg; done;

Yes, above command will rename all the files with extension “JPG” to “jpg”

techfiz:~/Desktop/New$ ls -al
total 8592
drwxr-xr-x 2 techfiz techfiz 4096 2008-09-04 00:40 .
drwx—— 5 techfiz techfiz 4096 2008-09-04 02:19 ..
-rwx—— 1 techfiz techfiz 372099 2008-09-02 19:39 IMG_0611.JPG
-rwx—— 1 techfiz techfiz 484697 2008-09-02 19:40 IMG_0612.JPG
-rwx—— 1 techfiz techfiz 374397 2008-09-03 23:28 IMG_0613.JPG
-rwx—— 1 techfiz techfiz 319788 2008-09-03 23:26 IMG_0614.JPG
-rwx—— 1 techfiz techfiz 489157 2008-09-02 19:56 IMG_0620.JPG
-rwx—— 1 techfiz techfiz 1084222 2008-09-02 19:59 IMG_0622.JPG
-rw-r–r– 1 techfiz techfiz 449 2008-09-04 00:41 Picasa.ini

techfiz:~/Desktop/New$ for i in *.JPG; do mv $i `basename $i .JPG`.jpg; done;

techfiz:~/Desktop/New$ ls -al
total 8592
drwxr-xr-x 2 techfiz techfiz 4096 2008-09-04 03:57 .
drwx—— 5 techfiz techfiz 4096 2008-09-04 02:19 ..
-rwx—— 1 techfiz techfiz 372099 2008-09-02 19:39 IMG_0611.jpg
-rwx—— 1 techfiz techfiz 484697 2008-09-02 19:40 IMG_0612.jpg
-rwx—— 1 techfiz techfiz 374397 2008-09-03 23:28 IMG_0613.jpg
-rwx—— 1 techfiz techfiz 319788 2008-09-03 23:26 IMG_0614.jpg
-rwx—— 1 techfiz techfiz 489157 2008-09-02 19:56 IMG_0620.jpg
-rwx—— 1 techfiz techfiz 1084222 2008-09-02 19:59 IMG_0622.jpg
-rw-r–r– 1 techfiz techfiz 449 2008-09-04 00:41 Picasa.ini

Here I’m using a loop to take the basename of each file (basename command gives the file name without extension) and adding JPG to identify the files with JPG extension. Once this is done, file is being moved with the same name but a different extension ie. jpg. quite easy isn’t it?

All that you need to understand here is for loop. For in the current directory check if the file has got the extension JPG, if yes, move the files to .jpg extension. Use basename command to identify the file name without extension.

nJoy!