joining 2 files together ?

Bill Moran wmoran at potentialtech.com
Thu Aug 7 15:38:26 UTC 2008


In response to beni <beni at brinckman.info>:
> 
> I am trying to find the equivalent for the old dos "copy file1+file2" command
> ("copy myfile1.txt+myfile2.txt" copies the contents in myfile2.txt and 
> combines it with the contents in myfile1.txt).
> But the standard freebsd "cp" doesn't seem to want the "+" between the two 
> files :
> 
> bsdaddict# cp file1.avi+file2.avi
> usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file
>        cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... 
> target_directory
> bsdaddict#    
> 
> So how to I append file2 at the end of file1 to get only one file ? To be more 
> specific : I would like to merge 2 avi files into one. How do I get 
> file1.avi+file2.avi into file3.avi ?
> Thanks.

Well, to answer your first question:
cp file1.avi file3.avi && cat file2.avi >> file3.avi

But to answer your real question, you can't just mash two avi files
together to make 1 big one.  You'll need something like avidemux or
one of the command line tools to actually get the avi headers correct.

-- 
Bill Moran
http://www.potentialtech.com


More information about the freebsd-questions mailing list