Joining MP3s, AACs or just about any audio file with Terminal UNIX commands

Occasionally I rip CDs with tracks that, at the time of ripping, I didn’t know I want to be combined — audiobooks come to mind. Sure I can go into iTunes (or XLD) and re-rip the tracks into one file. Or I can open Fission and combine the files that way. But each of those solutions is super time consuming. A faster way is just to use some command line goodness and join the data through there.

It bares mentioning that this process does require a tiny bit of computer proficiency. Not much, but some. This is also a Mac solution for Windows visit the source link at the bottom of the page.

So how do we do this? Well first open Terminal and head over to a folder holding all your MP3s or AACs or whatever. The simple way to do this is to use the cd command to change directory. I like to type cd into the terminal then just drag the folder from the finder onto the Terminal window.

cd /Users/ben/Documents/Audio

Then hit return. You should be in whatever folder you just dragged onto the Terminal window. You can test this by running the list command.

ls

Now we are ready to run the combine files magic, type in:

cat *.mp3 > new.mp3

following the file with the correct extension (.mp3 or .m4a or .flac, etc.)

Optionally you can also add in specific files into the mix by doing the following:

cat first.mp3 second.mp3 third.mp3 > new.mp3

After a span of time, depending on the size of your source files, you should have a new audiofile called new. That’s it!

A good rule of thumb at this point is to open the file in your favorite audio tagging app (iTunes, Tagger, Tag) and rename the combined file, as the file will also inherit all the tags of its parts. Huzzah! You are now a computer warlock and will probably be burned at the stake for your witchcraft. Sorry.

(source: http://stream-recorder.com/forum/join-multiple-mp3-files-t4656.html)

I’ve also tested this with .txt text files for work. It works perfectly! Huzzah!