Itunes and Terminal Gurus; search file format question

Discussion in 'macOS' started by coreybox, Aug 18, 2009.

  1. coreybox macrumors member

    Oct 28, 2005

    Through some scripting mishap, I accidentally ended up with two copies of everything in my iTunes library. One was in lossless format, the other in AAC.

    I just went through and deleted all the AACs by hand. I'm worried that I might have accidentally deleted a lossless copy though, in stead of the AAC copy.

    Is there a way I can search through the trash (via terminal presumably) to make sure there are no lossless files in there? It'd be so easy if they didn't have the same extension....

  2. RemarkabLee macrumors 6502a

    Nov 14, 2007
    file <filename>
    Should tell you the contents of the file, whether it is lossless or AAC.

    Write a script around that command :)
  3. coreybox thread starter macrumors member

    Oct 28, 2005
    Thanks for the response.

    Sadly, I tried that last night but couldn't get it to work. The file command seemingly returns the same information for both lossless and aac files.
  4. coreybox thread starter macrumors member

    Oct 28, 2005
    Here is a picture illustrating what I said above:


    The top file is a known AAC file, the bottom is an apple lossless file. The output of the file command is identical.

    Anybody know a way to differentiate them using some terminal command?

  5. rpp3po macrumors regular

    Aug 16, 2003
    Next time you try something like that, just add the file type column to iTunes and sort by it. The upper half will be AAC the lower ALAC. ;)

    For your present problem use 'afinfo --brief <filename>'.
  6. coreybox thread starter macrumors member

    Oct 28, 2005
    thank you! The simplest solution is the best!

    I wasn't aware that was even a display option in iTunes...

Share This Page