NAVIGATION
Home
Gallery
Java
Linux
Web
Scripts And Utilities
Mobile And Sms
Misc
Contact
pixelWIKI
Nabaz Tag




<<

Music And Video Shell Scripts

Use the first column of a filename as track number for an ID3 tag:
for format "01 - enter sandman.mp3"
for i in *.mp3 ; do id3tag -t `echo $i | awk '{print $1}'` "$i" ; done
for format "01_-_enter_sandman.mp3"
for i in *.mp3 ; do id3tag -t `echo $i | awk -F_ '{print $1}'` "$i" ; done

Rename a file to "01 - something.mp3" based on ID3 tags
for i in *.mp3 ; do mv "$i" "`id3info "$i" | grep TRCK | awk -F': ' '{print $2}' | awk -F'/' '{print $1}'` - `id3info "$i" | grep TIT2 | awk -F': ' '{print $2}'`.mp3" ; done ; for i in ? -* ; do mv "$i" "0$i" ; done

Find 100 random MP3s under 6mb
combine this with Udev Rules to create an automatic shuffled playlist on an MP3 player
find . -type f -name *.mp3 -size -6M | sort -R | head -100


see also:
Sed And Awk
flac To Mp3