# How to merge or split pdf files using convert
[source: https://linuxcommando.blogspot.com/2015/03/how-to-merge-or-split-pdf-files-using.html](https://linuxcommando.blogspot.com/2015/03/how-to-merge-or-split-pdf-files-using.html)
_convert_ is a member of the _ImageMagick_ software suite for image manipulation. Two of my earlier posts dealt with using convert to slice and resize an image. It is a lesser-known fact that convert also works with pdf files.
First, you need to install convert which is packaged in the _ImageMagick_ suite.
```[bash]
$ sudo apt-get install imagemagick
```
### Merge full pdf files
Merging 2 pdf files (file1 and file2) into a new file (output) is as simple as executing:
$ convert file1.pdf file2.pdf output.pdf
### Merge partial pdf files
You can merge a subset of pages instead of the entire input files. To accomplish that, use the angle brackets to specify the target subset of pages. For example, to merge page 1 of file1 with pages 1, 2 and 4 of file2, run the following command:
$ convert file1.pdf[0] file2.pdf[0-1,3] output.pdf
Note that page numbers are zero-based. Therefore, [0] is page 1, and [0-1] are the pages ranging from page 1 to page 2.
### Split pdf files
Finally, the following example splits up input into 2 files: first2output and next2output. The former output file contains pages 1 and 2 from the original file; the latter, pages 3 and 4.
$ convert input.pdf[0-1] first2output.pdf
$ convert input.pdf[2-3] next2output.pdf