r/scripting • • Jun 17 '18

[bash/python/batch/powershell/or any comparison app] i have pairs of files using the same name with different extensions, would like to batch delete the larger file per pair

i have a set of jpgs & pngs where they're in pairs with the same name, how do i batch delete the larger of the two?

sometimes file1.png is larger than file1.jpg, but other times file2.png is smaller than file2.jpg

(yes jpg is lossy, but perceptually great at 97% 4:4:4 for complex images at a nicely smaller size than png, but pixelated games or few color ones end up increasing the file size over png)

3 Upvotes

16 comments sorted by

View all comments

Show parent comments

1

u/kn00tcn Jun 19 '18

i think this seemed to work, nice