Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a bunch of folders with + instead of spaces. I tried mmv '*+*' '#1_#2' as well as mmv '*\+*' '#1_#2' with the result

+ -> #1_#2 : no match.

and

+ -> #1_#2 : no match.

respectively.

What am I missing?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Do it as mmv -r '*+*' '#1_#2'

man mmv says,

-r :   rename source file or directory to target name. The target name must not
       include a path: the file remains in the same directory in all cases. This
       option is the only way of renaming directories under mmv.
share|improve this answer
add comment

I haven't used mmv before, but for something like this I'd go into the folder that you want to rename files in, and in a bash shell do something like:

for f in *; do mv "$f" "${f//+/ }"; done

Someone else here showed me this, and I asked about it. the ${f//+/ } is called Bash Shell Expansion. //+/ substitutes a space for a plus.

share|improve this answer
    
This also works but as the question was targeted at using mmv I favor a solution using it. Can't upvote with only 8 rep... –  black_puppydog Nov 29 '11 at 0:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.