lpq command is used to display the status information about print jobs in the print queue. It is commonly used to check the status of print jobs, including the number of jobs in the queue, the status of each job, and the name of the user who submitted the job.
lpq command is used to display information about print jobs in the print queue. The syntax for the command is as follows:
lpq [options] [printer]
printer is the name of the printer you want to check. If no printer is specified, the default printer is used.
The output of the
lpq command includes the following information:
- The job number
- The status of the job
- The name of the user who submitted the job
- The size of the job in bytes
- The time and date the job was submitted
Here is an example of how to use the
$ lpq Printer: myprinter Queue: 1 job on myprinter Rank Owner Job File(s) Total Size 1st john 1234 myfile.txt 1024 bytes
In this example, the
lpq command displays the status of the print job with job number
1234 on the printer named
myprinter. The job was submitted by the user named
john, and the size of the job is
The following table lists the available options for the
||Specifies the name of the printer to check.|
||Shows the status of all printers.|
||Displays a more detailed output, including the time and date the job will be printed, the job priority, and the job size in pages.|
||Specifies the name of the print server to use.|
||Specifies the username to use when connecting to the print server.|
||Displays a help message and exits.|
lpq command does not display any output, there may be no print jobs in the queue. You can use the
lp command to submit a test print job and verify that the printer is working properly.
lpq command displays an error message, make sure that the printer is properly configured and connected to the network. You may also need to check the printer’s log files for more information about the error.
lpqcommand is part of the Common Unix Printing System (CUPS) and is available on most Linux distributions.
lpqcommand can be used in scripts to check the status of print jobs and take action based on the results.
lpqcommand is a useful tool for system administrators who need to monitor the status of print jobs on multiple printers.