Skip to content

Instantly share code, notes, and snippets.

@ume3
Created May 5, 2012 18:36
Show Gist options
  • Save ume3/2604641 to your computer and use it in GitHub Desktop.
Save ume3/2604641 to your computer and use it in GitHub Desktop.
Move files using Ruby FileUtils
require 'fileutils'
# move all "foo.ext" files in a directory to "foo/bar.ext"
Dir['.ext'].each { |f| FileUtils.move(f, "#{File.basename(x, '.ext')}/bar.ext") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment