Rename all the file extenstions in a directory

From thelinuxwiki
Revision as of 16:03, 24 May 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Rename all the file extenstions in a directory(JPG to jpg in this example):

for file in *.JPG ; do mv $file `echo $file | sed 's/\(.*\.\)JPG/\jpg/'` ; done