Printing From The Command Line

Printing is not an involved process whether you click on a button in a GUI or type commands from the command line. But you can cancel print jobs or view jobs in the print queue very quickly by typing a few short commands.

The lpr command followed by a filename sends that file to the print queue, for example lpr foo.txt prints the foo.txt file.

To view the jobs waiting in the print queue, just type lpq at the command line. You can cancel jobs in the queue by typing lprm followed by the print job number. Get the job number from the print queue. Type lpq, and you will see information similar to this:

active root  389  foo.txt

In this example, 389 is the job number. To cancel this print job, you would type lprm 389 and press [Enter].