lpr
.Table 22-5. Common lpstat Options
To see the status of a printer queue, the lpq
program is used. This allows us to view the status of the queue and the print jobs it contains. Here is an example of an empty queue for a system default printer named printer:
[me@linuxbox ˜]$ lpq
printer is ready no entries
If we do not specify a printer (using the -P
option), the system’s default printer is shown. If we send a job to the printer and then look at the queue, we will see it listed:
[me@linuxbox ˜]$ls *.txt | pr −3 | lp
request id is printer-603 (1 file(s)) [me@linuxbox ˜]$lpq
printer is ready and printing Rank Owner Job File(s) Total Size active me 603 (stdin) 1024 bytes
CUPS supplies two programs used to terminate print jobs and remove them from the print queue. One is Berkeley style (lprm
), and the other is System V (cancel
). They differ slightly in the options they support but do basically the same thing. Using our print job above as an example, we could stop the job and remove it this way:
[me@linuxbox ˜]$cancel 603
[me@linuxbox ˜]$lpq
printer is ready no entries
Each command has options for removing all the jobs belonging to a particular user, particular printer, and multiple job numbers. Their respective man pages have all the details.