Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-09-2007, 09:04 AM   #1
Registered: Dec 2005
Posts: 65

Rep: Reputation: 15
Find files with different extensions

Hei guys.
I would like to search for files with the same name and different extensions and output only the files with a certain extension. Example: music.mp3 and music.wav will output only music.mp3, but m.mp3 and n.wav won't output nothing (no match).
Old 03-09-2007, 09:48 AM   #2
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
This does that trick:
# for i in $(ls *|cut -d'.' -f1|sort|uniq -d); do find . -name $i.mp3; done
It will only list files with are named with 'multiple' extensions (more than 2).
Then, from those it will only list the ones with extension: .mp3
Old 03-09-2007, 03:38 PM   #3
Registered: Dec 2005
Posts: 65

Original Poster
Rep: Reputation: 15
thanks, will give it a try


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
remove files excluding those with specified extensions Melsync Linux - General 17 08-14-2015 05:16 AM
files extensions BillyF General 4 02-17-2007 05:17 PM
Finding multiple files with different extensions ExoZagNoid Linux - Newbie 1 01-18-2006 03:33 AM
files with extensions ;type=i santoshraju Linux - General 2 12-11-2004 10:31 AM
Where do I find my extensions for firefox? DavidBroome SUSE / openSUSE 2 11-27-2004 01:00 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration