Linux mass rename dashes to underscores

Bash script to rename – to _ in folders. eg: Changes 2012-05-05 to 2012_05_05 

for i in *_*; do mv "$i" "`echo $i | tr '_' ' '`"; done

Leave a Reply

Your email address will not be published. Required fields are marked *