samtools merge description
Samtools merge merges multiple sorted alignments. The header reference lists of all the input BAM files, and the SQ headers of inh.sam, if any, must all refer to the same set of reference sequences. The header reference list and (unless overridden by -h) headers of in1.bam will be copied to out.bam, and the headers of other files will be ignored.
Parent program: samtools
SAMTools provide various utilities for manipulating alignments in the SAM format, including sorting, merging, indexing and generating alignments in a per-position format. It is very convinient for handling reads mapped to reference genome. Normally SAMtools is used in intermediate step between raw read mapping and SNP or variants callingm, because it allows to effeciently store mapped reads.