Find directories that DON'T contain a file but YES another one

Posted by muixca on Ask Ubuntu See other posts from Ask Ubuntu or by muixca
Published on 2013-11-02T15:50:32Z Indexed on 2013/11/02 16:01 UTC
Read the original article Hit count: 284

Filed under:
|

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:

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.

© Ask Ubuntu or respective owner

Related posts about directory

Related posts about find