I have a directory of files with filenames of the form <num1>v<num2>.txt.  I'd like to find all files for which <num1> is a duplicate.  When duplicates are found, we should delete the ones with smaller <num2>.Is this possible?  I could easily write a python script to handle this, but thought it might be a nice application of built-in zsh features.ExampleIn the following list of files, the first three have duplicate <num1> parts.  As well, the fourth and fifth are duplicate.012345v1.txt012345v2.txt012345v3.txt3333v4.txt3333v7.txt11111v11.txtI would like to end up with directory containing012345v3.txt3333v7.txt11111v11.txt
zsh globbing - Find files with duplicate filename strings
shell;command line;zsh