Linux: Get number of pages of PDF document via command line

PHOTO EMBED

Sun Aug 28 2022 22:48:37 GMT+0000 (UTC)

Saved by @marcopinero #css

$> pdfinfo document.pdf | grep "Pages\:" | grep -o "[0-9]"
content_copyCOPY

In order to get web preview of pdf files from my web server I needed to get number of pages of the file. This single command gives this information directly.