5
5
I would like to set up a simple filtering system on my FreeBSD server that allows me to create arbitrary "views" of directories.
For instance, I'd like to be able to list all directories that match the pattern "*.mp3" but only display the directory name.
For instance, if I ran the command on my music folder I would like to be able to show all directories that have mp3s in them in one command, and all directories that have flac files in them as a separate command.
The command find . -name "*.mp3"
almost does what I want but it displays one entry for each file. Is there a way to limit find to one result per directory?
Perfect, thanks. I prefer avoiding xargs if possible for clarity of command. – javanix – 2011-11-14T18:49:14.207