Computing.Net > Forums > Unix > rm files with same prefix, diff suf

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

rm files with same prefix, diff suf

Reply to Message Icon

Name: daemonllama
Date: October 2, 2003 at 11:28:10 Pacific
OS: OSX
CPU/Ram: 800MHz 768mb
Comment:

How can I find and delete files which have identical
preffixes, but different suffixes and content? In this
case I have a large collection of MP3s, most in AAC
format, but some in Mpeg format. Many of the AAC
files have duplicates in Mpeg format and I wish to
get rid of these.



Sponsored Link
Ads by Google

Response Number 1
Name: Jerry Lemieux
Date: October 7, 2003 at 18:08:56 Pacific
Reply:

What's wrong with:

*.<suffix>

For example, if you have files with the name:

junk.txt
junk1.txt
junk.doc
junk1.doc

You'd type rm *.txt to get rid of the .txt files.



0

Response Number 2
Name: daemonllama
Date: October 10, 2003 at 20:59:46 Pacific
Reply:

Ah, but I need to only remove the ones that have a
AAC counterpart. Thanks, but I ended up figuring
out how to write a script for it on my own.
First I had it find every AAC and save the list, then I
had it replace the .m4a suffix with .mp3, then had it
find and move any file that matched that list.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: rm files with same prefix, diff suf

Files with equal names www.computing.net/answers/unix/files-with-equal-names/4198.html

findig files with date extensions www.computing.net/answers/unix/findig-files-with-date-extensions/7900.html

Bash: rename files with 2 spaces www.computing.net/answers/unix/bash-rename-files-with-2-spaces/7140.html