Skip to content

Instantly share code, notes, and snippets.

@watermint
Created March 20, 2013 08:32
Show Gist options
  • Save watermint/5203174 to your computer and use it in GitHub Desktop.
Save watermint/5203174 to your computer and use it in GitHub Desktop.
rename-yyyymmdd-to-iso8601.rb
Dir.entries('.').keep_if {|x| x.start_with?('2') }.each do |d|
d =~ /^(2[0-9]{3})([0-9]{2})([0-9]{2})$/
puts "mv #{d} #{$1}-#{$2}-#{$3}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment