-4
I have a directory with 2000 files, many have the same name and different extension, ex: diff001.txt diff001.pdf diff003.txt diff013.txt diff014.pdf diff021.txt diff021.pdf in this case I would like to keep only the file with the txt extension and delete the pdf.
I have no idea how to do it. Thank you.
Isn’t it easier to make OS? For example from zsh:
rm -- *.pdf(e'{[ -e $REPLY:r.txt]}')
– Augusto Vasques