uncategorized

Rename all files that end in 'JPEG' with 'jpg'

Script

This script will save the path and name of all files ending in JPEG in the FN variable.
Then goes through each entry and renames the files (and displays the file it’s on)

1
2
3
4
5
6
#!/bin/bash
FN=$( find /rpool/wav -type f -name "*JPEG" -exec echo {} \; )
for i in $FN ; do
echo mv $i $( echo $i | sed 's/JPEG/jpg/' )
mv $i $( echo $i | sed 's/JPEG/jpg/' )
done
Share