replace a 'space' char in filename with an underscore

Posted by user38730 on Server Fault See other posts from Server Fault or by user38730
Published on 2010-04-16T08:12:23Z Indexed on 2010/04/16 8:13 UTC
Read the original article Hit count: 304

Filed under:
|

I have a bunch of files in a directory with 'spaces' in the filename.

How do I perform a bulk rename of all filenames with 'spaces' and replace them with an '_' char.

Looking at the other solutions, I've tried the following command w/o success:

find . -name '* *' -exec rename ' ' '_' {} +

find: rename: No such file or directory

© Server Fault or respective owner

Related posts about filename

Related posts about replace