Skip to content

Instantly share code, notes, and snippets.

@PatheticMustan
Created July 9, 2023 17:20
Show Gist options
  • Save PatheticMustan/f2514b11bf547394bb2e24c1a0ebe5ba to your computer and use it in GitHub Desktop.
Save PatheticMustan/f2514b11bf547394bb2e24c1a0ebe5ba to your computer and use it in GitHub Desktop.
remove dupe photos
const testFolder = './';
const fs = require('fs');
let n = 0;
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
if (file.includes("(1)") || file.includes("(2)") || file.includes("(3)")) {
//console.log(file);
n++;
fs.unlinkSync(file)
}
});
console.log(`cleaned ${n} dupes`)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment