Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    You left out the :%s/.*/"&"/ step -- because, in this case, you know that every filename contains at least one space. Commented Nov 21, 2014 at 20:44
  • 1
    This will bite you if the file names contain spaces or other special characters. You need to quote them properly. Reviewing a list of commands isn't particularly likely to catch errors. There are far better ways to review commands before running them, such as runing echo mv instead of mv, and then removing the echo if you're happy. Commented Nov 21, 2014 at 23:16
  • Spotting a mistake like filenames-with-spaces is precisely what this technique will help with :-) Commented Nov 21, 2014 at 23:40