Find directories that DON'T contain a file but YES another one
- by muixca
I have quite a large music collection and would like to find the directories in which I still have compressed files (*.rar) unprocessed. Hence looking for a command that lists directories in which i do NOT have *.flac or *.mp3 but YES *.rar present. Working off found examples in this post:
Find directories that DON'T contain a file
I tried:
comm -3 \
<(find ~/Music/ -iname "*.rar" -not -iname "*.flac" -not -iname "*.mp3" -printf '%h\n' | sort -u) \
<(find ~/Music/ -maxdepth 5 -mindepth 2 -type d | sort) \
| sed 's/^.*Music\///'
but don' work.