Sunday, September 18, 2022

Trivial line for Splitting file names

 

I have a Bluetooth speaker with USB support. Come next storm ( and power disruption) I have one pen drive full of classic rock songs . The problem is they are named as such " Artist - Song.mp3  and in the dir, they play alphabetically .. ah darn .. all AC/DC songs at one go.. lets change the file names as such "song.mp3" :-)

 

 for i in *.mp3 ; do  mv -v "$i" "${i#* -}"  ; done


does the trick . Bash pattern matching 

No comments:

Post a Comment