I have the following directory tree:
/Directories/
/Directories/somedir/somefile.mkv
/Directories/somefile.rar
I'm trying to find a way to delete the .rar file if the .mkv file exists and is larger than 1 GB.
I've use find -type f -size +1000000k -name "*.mkv" to find the files. I then presume that either -exec or | xargs could help with the rest but I don't know how to exit the output of find before passing it to rm. In my scenario the output would be /Directories/somedir/somefile.mkv and the command passed to rm would Directories/*.rar
Can I do this with -exec or xargs. Is there a more elegant solution?