CUPS understands many different types of files directly, including text, PostScript, PDF, and image files. This allows you to print from inside your applications or at the command-line, whichever is most convenient! Type either of the following commands to print a file to the default (or only) printer on the system:
-d option with the
lp command to print to a specific printer:
lp -d printer filename
-P option with the
lpr -P printer filename
Printing the Output of a Program
lpr commands support printing from the standard input:
program | lp program | lp -d printer program | lpr program | lpr -P printer
If the program does not provide any output, then nothing will be queued for printing.
Source and more Details.