Forrest logo
back to the pdftk tool

pdftk:tldr:6d69a

pdftk: Merge (concatenate) a list of PDF files and save the result as another one.
$ pdftk ${file1-pdf file2-pdf ---} cat output ${output-pdf}
try on your machine

The command is using the utility pdftk (PDF toolkit) to merge multiple PDF files into a single output file.

Here is a breakdown of the command syntax:

  • ${file1-pdf, file2-pdf, ...}: This part represents the input PDF files you want to merge. It uses brace expansion to list multiple PDF files separated by a space. The actual file names may vary, but they need to end with ".pdf" extension.

  • cat: This is the pdftk operation that specifies to concatenate or merge the input PDFs.

  • output ${output-pdf}: This part specifies the output file name and its path. You can replace "${output-pdf}" with the desired name of the output file, including the ".pdf" extension.

Overall, the command takes multiple input PDF files (file1.pdf, file2.pdf, etc.), concatenates them using the "cat" operation, and creates a single output PDF file with the desired name (${output-pdf}).

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pdftk tool