wiki:linux/bash/Replace extension of several files

Bashskript zum Umbenennen von Dateien, Replace extension of several files

Change the extension for a batch of files is quite easy with linux on-board tools ls, cut? with little help of rev? and finally xargs:

$ ls *JPEG | rev | cut -c 6- | rev | xargs -I filename mv filename.JPEG filename.jpg

This line will rename all JPEG files in the current folder to jpg files.

Last modified 5 years ago Last modified on Dec 11, 2014, 11:09:10 AM