I used this method on CentOS5 and used the rpmforge repository to install mencoder (yum install mencoder).

mencoder -forceidx -ovc copy -oac copy -o combinedfilename.avi firstfilename.avi secondfilename.avi