Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Rename files in bash via string handling' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Rename files in bash via string handling
Authored by: MordEth on Sep 07, '06 10:31:46AM

Another thing you may wish to look into is using sed. I do a lot of quick renames this way, for example:

for i in *.mp3; do mv $i `sed -e "s/^[01][0-9]_/artist--/g"`; done

This would convert files that begin with "##_" (where ## is between 00 and 19) to start with "artist--" instead.

Here is a useful and concise guide to regular expressions that I've recommended to other people in the past (which could be used with sed, awk, grep, perl, etc.):

[ Reply to This | # ]