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
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.
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.
Summary: You can't have two files with the same name. The OS won't allow that. Apparently there are hidden characters in one of the file names. That also happens when the OS seems to not find a file. To you ...
Summary: Depending on the naming convention you could use a simple find command. Are all of the file names(file1, file2, etc) the same? Do all of the extensions start with 2007? find . -name file*.2007* would...
Summary: I'm interpreting that you want to find all the files with two spaces in the name and rename them to one? There's no need to escape the spaces, and you need to make sure ls returns only one file name a...