BreadCrumbs: Bash Rename File Extensions
Bash Rename File Extensions
From Luke Jackson
(Difference between revisions)
Revision as of 01:16, 4 November 2006
Contents |
[edit]
Summary
This is a simple function to quickly rename many files using Bash. It can be very useful for renaming pictures, mp3s, and movies.
[edit]
Supported Operating Systems
- Mac OS X and Terminal
- Unix
- Linux
[edit]
Requirements
- Bash
[edit]
Syntax
Below is a simple example for renaming uppercase jpg files to lowercase:
for i in *.JPG; do mv $i ${i%%.JPG}.jpg; done
If you would like to use this function for other types of files here is a basic template:
for i in *.<EXISTING_EXT>; do mv $i ${i%%.<EXISTING_EXT>}.<RESULTING_EXT>; done