[HowTo] Join Audio Or Video Files In Ubuntu

Sometime you want to join a couple of files to be 1 file. You can do that really easy in Ubuntu or any Linux. But in this case i will show in Ubuntu only, since my pc is using Ubuntu. You can join files with “cat” command. What file type can be joined with this command? Well as far as i know you can join text files, audio files and video files. haven’t tried for other files like ISO files. If you tried it and successed please let me know by leave the comment.

Well “cat” command is really useful. I used it a lot for joining text files. But for now i want to show you how to join audio files or video files. Here is the command format:

cat file1 file2 file3 > joinedfile

Example of joining audio files:

cat audio1.mp3 audio2.mp3 > compiled.mp3

Example of joining video files:

cat video1.mpg video2.mpg > compiled.mpg

Please be careful if you joining a large file, it will take many resource and make your system freeze. So please make sure your resources is enough.  You can how to use “cat” command by type

cat --help


man cat

PS: you can join video files by using mencoder too, here is the example:

mencoder -oac copy -o joined.mpeg movie1.mpeg movie2.mpeg


  1. Ketanbhardwaj says:

    Thanks a lot…. that really works 🙁

  2. GrouchyGaijin says:

    Man, this was really helpful.

  3. cIIIz says:

    Thanks so much 😀 I was about to use audacity to do that, but this is much more fast!

  4. John says:

    This is nonsense. Using cat (concatenation) for audio and/or video files doesn't work because the header at the start isn't modified and only specifies the length of the first audio/video file. Therefore, with a audio player that respects this header (mplayer/audacity) this will not work, and most likely even corrupt the file because it's data section doesn't match the given header. Anyone using cat for this is risking corrupt output files.

  5. AlphaDog says:

    It doesnt work for .wma files. The output is the last file in inputs

  6. Tgtnations says:

    I have a couple of video files .MOD that concatenated into one it worked for me on my system.

  7. Xian Martins says:

    It`s interesting. The power of streams in unix > < but not always is so simply…

    I tried it and it didn't work.
    It's true that join the files, the output file size is a sum of other sizes, but only reproduce one part of these files, and the total time it's show incorrectly

    Cat – join files, but not format correctly the video params in output file….

  8. S1a1n1bajaj says:

    Really so simple. As i am new to ubuntu and if I can do then be sure everyone can do the enjoyable thing. Its really so fast.

    Thanx again for this article 🙂

  9. Shutthe says:

    WTF. Stop spewing nonsense and ignorance. This "hack" may work in media files with same bitrate. But not all files can be binary concatenated and still have a valid data stream.

  10. Bjarne P. says:

    Ivan, any chance you know how I can install Linux on my Samsung Tab S7 Plus tablet? There is apparently no available AOSP de-googled Android OS available and wanted to ask if you know of any way to install Linux distros on Samsung Tabs?

Give me your feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.