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




<<

Sed And Awk

Search and replace on filenames:
for i in *.* ; do mv "$i" "`echo $i | sed -e 's/bob/bill/g'`" ; done

making filenames uppercase
for i in *.* ; do mv "$i" "`echo "$i" | tr a-z A-Z`" ; done

Use the first 2 characters of a filename as track number for an ID3 tag:
for i in *.mp3 ; do id3tag -t `echo $i | gawk --field-separator= '{print $1$2}'` ; done

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}'` ; done
for format "01_-_enter_sandman.mp3"
for i in *.mp3 ; do id3tag -t `echo $i | awk -F_ '{print $1}'` ; done

Make a filename Title Case

for i in *.mp3 ; do mv "$i" "`echo $i | sed -r -e 's/([^.])([a-z])([a-z]+)/\1\u\2\3/g'`" ; done