user5198 user5198 - 1 year ago 92
Linux Question

find all audio files in a folder using bash in linux

When I am using wildcards with

command, it works.

$ ls '*.{mp3,ogg}' # Showing only two formats in the command
cannot access *.mp3: No such file or directory
1.ogg 2.ogg 3.ogg

but using find command doesn't work

$ find ~ -iname '*.{mp3,ogg}'

What is the error in the line?

Answer Source

I think this should work for you

   find ~ -name "*.mp3" -o -name "*.ogg"

-o is equivalent to boolean or

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download