Quantcast
Viewing all articles
Browse latest Browse all 20

LPR printing on command line

These days, with Linux distros such as Ubuntu, printing is quite easy. You can add and remove printers and print files just as easily (or even more so) compared to Windows or Mac. Sometimes I might just want to print from the command line. To do so, I make use of the lpr command.

To find out what printers are available, type:

 <pre class="src src-sh">lpstat -p -d <span style="color: #ff4500;">## </span><span style="color: #ff4500;">from CUPS manual</span>

This and this gives a good introduction to lpr.

 <pre class="src src-sh">lpr filename <span style="color: #ff4500;">## </span><span style="color: #ff4500;">print file using default printer</span>

lpr -P printername filename ## print file using the selected printer; see lpstat -p -d for list of printers lpr -# num filename ## to print num times

openoffice -p filename.doc ## for doc files

lpr should support txt, ps, and pdf files.


Viewing all articles
Browse latest Browse all 20

Trending Articles