I'm trying to find out all of the different types of files in my unorganized music folder. I've been trying this command (to list files of types besides the ones I know are in there):
find zUnorganized/ -not -iname "*.mp3" -and -not -iname "*.flac" -and -not -iname "*.MP3" -and -not -iname "*.wav" -or -not -iname "*.m4a" -and -not -iname "*.jpg"
But it's not working. How would I get that command work? Is there a way to do it using -regex?
Thanks!
Best Answer
You wrote (redundant parentheses added for clarity):
Either use
-and -not
throughout, or useor
throughout and finish with-print
(meaning: do nothing for this, otherwise do nothing for that, etc, otherwise print). You'll also want to limit the search to regular files, otherwise directories will be listed.