I want to use pdftk to merge all pdffiles in a directory and all of its subdirectories. I cannot find a --recursive option in the man pages.

Doing this manually (using a GUI) is not an option as it would be too much work.

Any suggestions?

2 Answers 2


I don't think this is ideal, but you could:

  1. cp all the pdf files of the subdirectories into one directory.

    mkdir all-in-one
    find SomeDirectory -iname '*.pdf' -exec cp {} all-in-one/
  2. concatenate them

    cd all-in-one
    pdftk *.pdf output output.pdf

The disadvantage of this solution is that you have to copy all the files.


This doesn't like file names that include spaces, but it seemed to work for a couple files in two different directories. That is a back quote (same key as the tilde character) surrounding the find|xargs pipeline.

pdftk `find . -name *.pdf -print|xargs echo` cat output out.pdf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .