Howto merge two avi files using ffmpeg?

You can use this single command line:

ffmpeg -i "concat:input1.avi|input2.avi|input3.avi" -c copy output.avi

You should look into the concat demux and concat protocol that was added in ffmpeg 1.1. Assuming the codecs are the same you create a file (example mylist.txt):

file '/path/here/file1.avi'
file '/path/here/file2.avi'
file '/path/here/file3.avi'

Then pass that file to ffmpeg

ffmpeg -f concat -i mylist.txt -c copy video_draft.avi

You can use this command to make the list:

ls *.avi | while read each; do echo "file '$each'" >> mylist.txt; done

The linked page has more advanced examples for dealing with issue like different codecs/formats.