Move files up one directory in Ruby
require 'fileutils' path = File.expand_path('../', __FILE__) Dir.glob("#{path}/**/*.*").each do |file| new_path = "#{path}/#{file.split('/')[-1]}" FileUtils.mv(file, new_path) end