How 2 rename al the files with same extension

[Solved/Closed]
Report
-
Posts
142
Registration date
Friday July 31, 2009
Status
Member
Last seen
August 7, 2009
-
Hello,
hai i want rename all the files which has an extension of .gif to .jpg using shell client......please help us...
thanks in advance

2 replies

for files in *.gif
do
   mv "$files" "${files%.gif}.jpg"
done 
Posts
142
Registration date
Friday July 31, 2009
Status
Member
Last seen
August 7, 2009
16
Hi :)

While linux tends to be able to ignore file extensions and correctly identify the correct coding of a file any Windows users will be completely stuck trying to open these renamed files. ".gif" and ".jpg" are very different ways of compressing an image requiring quite different decoding mechanisms. If you use Gimp or something similar then doing 2Save As ..." and changing the file-extension is enough to make Gimp (or whichever) translate the picture from one format to another. Simply changing the file-extension through a bash-script will not (afaik)

https://www.gimp.org/docs/

Gimp is probably included in the standard install of whichever flavour of linux you have installed
Good luck and regards from
Tom :)