find mp3- and m4a-files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find mp3- and m4a-files
# 1  
Old 12-19-2011
find mp3- and m4a-files

Hi,

I will find all mp3 and m4a files on a certain volume with regular expressions. The following command will not work (I am new to this)
Code:
find /Volumes/music/ -iname '*.m[p34a]'

Does anyone can help me with the right syntax?

muetze

PS Mac OS X

Last edited by jim mcnamara; 12-19-2011 at 04:06 PM.. Reason: code tags
# 2  
Old 12-19-2011
Code:
-iname "*.mp3" -o -iname "*.m4a"

# 3  
Old 12-19-2011
Not sure about Mac OS X but with GNU find you would need something like this:

Code:
find  /Volumes/music/ -regextype posix-extended -iregex '.*\.mp[34]a?'

And this one should work with most (all?) find implementations:

Code:
find /Volumes/music/ -name '*.[Mm][Pp]3' -o -name '*.[Mm][Pp]4[Aa]'

# 4  
Old 12-19-2011
-iname is used with wildcards, -iregex with regular expressions.

Something like this would "partially" work in MacOS (file names such as "file.m43" would also match the pattern):

Code:
find /Volumes/music -iname "*.m[p4][3a]"

With regexp:

Code:
find /Volumes/music -iregex '.*\.m[p4][3a]$'

# 5  
Old 12-19-2011
Thank you very much for your very fast help, now it works.

muetze
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to rename mp3 files

hi there, i'm using OS X. i have a bunch of mp3 files strewn across a directory tree that i'd like to rename. specifically i'd like to remove any track numbers and leading non-alphabetic characters from the filenames like this: 01 - song1.mp3 2 song2.mp3 become: song1.mp3... (6 Replies)
Discussion started by: creakyshrimp
6 Replies

2. Shell Programming and Scripting

Commando to find and move mp3 file and directory

Hello, I have a lot of mp3 in a various directory. My goal is a command that find all mp3 file and move the files and directory where is the mp3 file to a destination folder. Is it possible? Thanks in advance (7 Replies)
Discussion started by: giangi007
7 Replies

3. Shell Programming and Scripting

Mp3 backup using find, mkisofs

Hi. I want to create a Linux script to find all local mp3 files, create an ISO image. Later I will attempt to use growisofs Something like this: find ~ -name "*.mp3" | xargs mkisofs -o musicbackup tried variations on this but no luck. (4 Replies)
Discussion started by: lancest
4 Replies

4. Programming

to find header in Mp3 file and retrieve data

hi all, In an mp3 file , data is arranged in sequence of header and data ,how to retrieve data between two headers. Is the data between two headers fixed? because as per theory it says 1152 samples will be there , but dont knw how many bits one sample correspond to? it would help if any c... (2 Replies)
Discussion started by: shashi
2 Replies

5. Linux

fedora: problem to play mp3 files.

hi friends. i have tried all above option to play mp3 files but i am not able to listen mp3 files. i have tried above option using yum like $ su - # yum install gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-ffmpeg i got a error like Loaded plugins: refresh-packagekit Could... (5 Replies)
Discussion started by: praneshmishra08
5 Replies

6. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

7. UNIX for Dummies Questions & Answers

mp3 codec

I just need a mp3 codec that will decode mp3s so I can play them with my media player (probably going to be using XMMS) (0 Replies)
Discussion started by: Synbios
0 Replies

8. Shell Programming and Scripting

Sorting mp3

Hi all... Here's my question: -> considering i've got thousands of mp3s', named like "Artist name - Track Name", how could i write a shell (ksh, or bash my favorite, not knowinf enough any other language) that would create a directory (if not existing already) with the Artist's name, and move... (3 Replies)
Discussion started by: penguin-friend
3 Replies
Login or Register to Ask a Question