printing only specified pages from a pdf file
gs -sDEVICE=pdfwrite -dFirstPage=a -dLastPage=b -sOutputFile=mynewfile.pdf myoldfile.pdf
splicing two pdf files together
gs -sDEVICE=pdfwrite -sOutputFile=mynewfile.pdf myoldfile1.pdf myoldfile2.pdf
general options that make life more easy
-dNOPAUSE %you don’t have to hit enter between pages
-dQUIET %you won’t see output from gs
-dBATCH