listing directories containing files of certain type
I'm looking to create a list of directories that contain files of a certain type, such as .mp3 files. I've got it mostly working with this command:
I only want the last entry. Is there any simple way to filter out the unwanted ones?
Note that sometimes the parent directories can contain files as well, so I can't just remove partial duplicates from the list after it's compiled (i.e. there are times when ./dira/dirb would also be a legitimate hit).
I cannot reproduce this behaviour. It prints only the name of the directories actually containing mp3 files, even if they are two or three levels below the current dir:
Doh! Actually, I've just discovered that it is working the way I want.
After posting I took a closer look at the list I had generated and found that all the "duplicates" it listed actually do have matching files in them. My memory of what was in the upper directories was a bit off and I failed to notice that it was only listing some of the upper directories.
Forget I ever asked anything. :( :)
|All times are GMT -5. The time now is 01:09 AM.|