Merge PDF files in Linux Terminal

Hello beautiful peoples!

I ran into a situation where I had 2 pdf files. I wanted to have 1 pdf file. Turns out its pretty simple. You can merge it using ghostscript.

  • Install ghostscript
sudo apt install ghostscript
  • Use it to merge the files
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=./merged_file.pdf ./part_1.pdf ./part_2.pdf ./part_3.pdf

This command will use gs application to merge files part_1.pdf, part_2.pdf and part_3.pdf into one file merged_file.pdf.

I hope this helps!

Catch you on the flip side,

AndrzejL

Avatar photo

AndrzejL

“Some men just want to watch the world burn.”

Leave a Reply

Your email address will not be published. Required fields are marked *