I am using Windows, and trying to use Cygwin to perform this task. I would like to rename the files and directories recursively as following:
I was thinking about using for loop, but for loop could not traverse the directories recursively. I can only use for and sed to rename a list of files in a directory:
for i in *; do j=`echo $i | sed 's/\(.\)\(..\)\(..\)\(.\)\(...\)\(.\)/\1-\2-\3-\4-\5-\6/g'`; mv $i $j; done
But I would like to rename several directories and the files within. So, I tried about "find", but I don't know how to use variables and regular expression with "find" command. Besides that, since I am using Cygwin, I can only use "mv" command instead of "rename" command. Thanks for any suggestions.