find the files like this:
find ./ -type f -name "*.mp3"
Pipe them into a loop:
help read
help while
find ./ ... | while read original ; do
newfile=$original
echo $original $newfile
done
It might be easy to use cut:
newfile=$(echo $original | cut -d'-' -f 3,1,2,4-)
# you can pipe commands as many as needed.
newfile=$(echo $original | cut -d'-' -f 3,1,2,4- | cut -d' ' -f 2,1- | tr -s ' ')
When happy with the results, replace echo
with mv
.
hruv-~/Downloads/Super Galactic Expansive/Super Galactic Expansive - Supersensible Science : ls *mp3
Super Galactic Expansive - Supersensible Science - 01 Intro.mp3
Super Galactic Expansive - Supersensible Science - 07 King James.mp3
Super Galactic Expansive - Supersensible Science - 02 Looking Glass.mp3
Super Galactic Expansive - Supersensible Science - 08 G-Gnome.mp3
Super Galactic Expansive - Supersensible Science - 03 Broken Clocks.mp3 Super Galactic Expansive - Supersensible Science - 09 Everpresent Future.mp3
Super Galactic Expansive - Supersensible Science - 04 Pillars.mp3 Super Galactic Expansive - Supersensible Science - 10 Samsara.mp3
Super Galactic Expansive - Supersensible Science - 05 Movement of Sound.mp3 Super Galactic Expansive - Supersensible Science - 11 Dhamma.mp3
Super Galactic Expansive - Supersensible Science - 06 Decipher.mp3 Super Galactic Expansive - Supersensible Science - 12 Blue Blood.mp3
>>>
dhruv-~/Downloads/Super Galactic Expansive/Super Galactic Expansive - Supersensible Science : ls *mp3 | awk '/[a-zA-Z ]-*/ { print $1 }'
Super
Super
Super
Super
Super
Super
Super
Super
Super
Super
Super
Super