Skip to content

Instantly share code, notes, and snippets.

@cmitz
Created March 4, 2017 10:46
Show Gist options
  • Save cmitz/0415d8f558486002f9888ce4c0100ffb to your computer and use it in GitHub Desktop.
Save cmitz/0415d8f558486002f9888ce4c0100ffb to your computer and use it in GitHub Desktop.
require 'pathname'
require 'fileutils'
dir = '.'
files = Dir["#{dir}/*-2.NEF"]
p "Files to remove: #{files.count}"
files.each do |file|
FileUtils.rm(file)
p "FileUtils.rm(file) #{file}"
end
p "Removed #{files.count} files"
# After duplicate images are deleted, RMB on folder in Lightroom
# and use "Synchronise" to cleanup
@cmitz
Copy link
Author

cmitz commented Mar 4, 2017

This code is to remove duplicate photos (.NEF) when Lightroom fucked up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment