$ gs -q -sPAPERSIZE=a4 \ -dNOPAUSE \ -dBATCH \ -sDEVICE=pdfwrite \ -sOutputFile=all.pdf \ 1.pdf \ 2.pdf \ 3.pdf \ ... \ N.pdf