How would I modify the following bash instruction to get only the directories that match exactly genre_
(basename) and another genre_*
. As the next step, I appended | wc -l
to the second find
, but I get for each line the same very high number, which tells me it's a count across directories (why?)?
$ find . -name 'genre_' -exec dirname {} \; | while EFS= read -r thedir; do echo "$(find . -name 'genre_*')"; done
./The-Specials/genre_
./The-Specials/genre_rock
./ACDC/genre_Hard-Rock
./We-3/genre_
./We-3/genre_Jazz
In the output above, only ACDC should be filtered out.