Combining PDF files with gs

Combine 2 or more pdf files to 1:
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=dest.pdf -f file1.pdf file2.pdf

Select page numbers from the input file:
gs -dNOPAUSE -dBATCH -dFirstPage=1 -dLastPage=1 …