You can use the
pdfjam tool with the syntax
pdfjam <input file> <page ranges> -o <output file>
and an example of page ranges would be
to extract pages from 1 to 10 and from 30 to 35, and put these pages into a single document. Note however that this will break the hyperlinks in your document.
 pdfjam is actually a front end for pdfpages, suggested in an other answer.
You could also use
pdfseparate from poppler to burst a document into separate pages. Using
pdfseparate <document> 'page_%d.pdf'
using the result of
pdfjam as a document will give you files named page_1.pdf … page_6.pdf containing all the desired pages.