LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-09-2007, 10:04 AM   #1
cdog
Member
 
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, 10:48 AM   #2
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
This does that trick:
Code:
# for i in $(ls *|cut -d'.' -f1|sort|uniq -d); do find . -name $i.mp3; done
./music.mp3
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, 04:38 PM   #3
cdog
Member
 
Registered: Dec 2005
Posts: 65

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


Reply


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
files extensions BillyF General 4 02-17-2007 06:17 PM
Finding multiple files with different extensions ExoZagNoid Linux - Newbie 1 01-18-2006 04:33 AM
remove files excluding those with specified extensions Melsync Linux - General 15 10-04-2005 02:42 PM
files with extensions ;type=i santoshraju Linux - General 2 12-11-2004 11:31 AM
Where do I find my extensions for firefox? DavidBroome Suse/Novell 2 11-27-2004 02:00 AM


All times are GMT -5. The time now is 06:47 AM.

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