Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I'm desperately trying to replace some files w/ spaces in the names w/ underscores. I ran this command in a directory: rename " " _ *\ * and it ...
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Posts
    24

    Cannot replace spaces w/ underscores

    Hello,
    I'm desperately trying to replace some files w/ spaces in the names w/ underscores.

    I ran this command in a directory: rename " " _ *\ * and it worked like a charm on every file except this one:

    MissMarieBand_Oh_No!_Not Again.wmv

    I then tried to take to remove the spaces w/ this: rename "s/ *//g" *.mov

    and it still ignores this file.

    Is there any way I can get around this?

    Thanks,
    Clem

  2. #2
    Just Joined!
    Join Date
    Aug 2007
    Posts
    37
    Quote Originally Posted by clem_c_rock View Post
    I ran this command in a directory: rename " " _ *\ * and it worked like a charm on every file except this one:

    MissMarieBand_Oh_No!_Not Again.wmv
    Try this:
    Code:
    rename "s/ /_/g" *.{mov,wmv}
    Quote Originally Posted by clem_c_rock View Post
    I then tried to take to remove the spaces w/ this: rename "s/ *//g" *.mov

    and it still ignores this file.
    This second version should have worked but you applied it to *.mov files instead of *.wmv files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...