Linux lpq Command
The Linux lpq command is used to view the status of a print queue; it can show the printer queue status and the print jobs it contains.
Syntax
lpq [l] [P] [user]
Parameter Description:
- -P Specify a printer; otherwise use the default printer or the one specified by the PRINTER environment variable
- -l Print information about all files that make up the job..
Example
An empty queue for the system's default printer, printer.
$ lpq
printer is ready
no entries
If no printer is specified in advance (using the -P option), the system will show the default printer. If you send a print job to the printer and then view the print queue, you will see a list like the following.
$ 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)
Linux Command Reference