I'm trying to create a series of playlists on my MP3 player, running Rockbox, by finding a file matching a string, using find /cygdrive/g/MUSIC -type f -name "Search Criteria" | /cygdrive/g/PLAYLIST/Playlist Name.m3u8
.
When I search using $ find /cygdrive/g/Music -type f -name "*Theme*"
, my results are:
/cygdrive/g/Music/Movie Masterpieces/14 - 1900's Theme.ogg
/cygdrive/g/Music/Movie Masterpieces/02 - Deborah's Theme.ogg
/cygdrive/g/Music/Star Trek_ The Motion Picture [Disc 1]/01 - Ilia's Theme.ogg
However, I would like to be able to search for any folder and output the names of the files inside, for an output similar to:
/cygdrive/g/Music/Cult Themes/01 - The Avengers (1965).ogg
/cygdrive/g/Music/Cult Themes/02 - Man In A Suitcase (1968).ogg
/cygdrive/g/Music/Cult Themes/03 - The Saint (1962).ogg
I have access to both a Linux terminal, cygwin or Windows command prompt, and would be grateful for any solution, but if possible in one or two lines.
Edit: After receiving the a number of solutions, I've found the best solution was:
find /cygdrive/g/MUSIC -type d -iname "*theme*" -print -prune
| xargs -d '\n' -I {} find {} -name '*.ogg'
This solution was able to complete the search the quickest, and whilst it may not be as brief as the first response, is still succinct. Thanks to all who responded!