user5198 user5198 - 1 month ago 7
Linux Question

find all audio files in a folder using bash in linux

When I am using wildcards with

ls
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

I think this should work for you

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

-o is equivalent to boolean or

Comments