Printing PDF from the Command Line


I had about 20 PDF files I needed to print out on my Powerbook and I didn't want to open each file in Preview and then tell each one to print, so I went out looking for ways to print PDF from the command line. I found this handy chapter about Unix-style printing in OS X (from an O'Reilly book) that told me that the lpr command on OS X just knows about PDF. So, in the end it was no more complicated than this:

for f in *.pdf
> do lpr -PCSOffice $f    
> done