On Unix-like operating systems, the lpstat command lists the status of LP print services.
Description
lpstat displays status information about the current classes, jobs, and printers. When run with no arguments, lpstat lists jobs queued by the current user.
- Description
- Installing CUPS
- Syntax
- Examples
- Related commands
- Linux commands help
lpstat is now part of the CUPS (Common Unix Printing System). You may need to install CUPS before using lpstat, and related tools such as lpr.
Installing CUPS
If you’re operating Debian, or a Debian-derived Linux system like Ubuntu that uses the APT package managements system, you can install them by running the following command:
sudo apt-get update && sudo apt-get install cups cups-client lpr
This command will install the Common Unix Printing System on your system. You should now be able to set up CUPS by directing any web browser to the address: http://localhost:631
Doing so opens a web-based CUPS configuration screen, which should look something like this:
Then, from the command line, add your user to the group lpadmin with the command:
sudo adduser
This command adds you to the group of users allowed to administer printers on your system.
You should now be able to check the status of your printers and your print jobs using lpstat.
Syntax
lpstat [ -E ] [ -H ] [ -U username ] [ -h hostname[:port] ] [ -l ] [ -W which-jobs ] [ -a [ destination(s) ] ] [ -c [ class(es) ] ] [ -d ] [ -o [ destination(s) ] ] [ -p [ printer(s) ] ] [ -r ] [ -R ] [ -s ] [ -t ] [ -u [ user(s) ] ] [ -v [ printer(s) ] ]
Options
Examples
lpstat -t
Display all printer information. Output resembles the following:
scheduler is running system default destination: PDF device for Lexmark_Pro700_Series: usb://Lexmark/Pro700%20Series?serial=90T7099T1914144&interface=1 device for PDF: cups-pdf:/ Lexmark_Pro700_Series accepting requests since Mon 18 Aug 2014 03:46:06 PM EDT PDF accepting requests since Sun 17 Aug 2014 09:51:41 PM EDT printer Lexmark_Pro700_Series disabled since Mon 18 Aug 2014 03:46:06 PM EDT - Unplugged or turned off printer PDF is idle. enabled since Sun 17 Aug 2014 09:51:41 PM EDT
lpstat -p
Display all installed printers. Output resembles the following:
printer Lexmark_Pro700_Series disabled since Mon 18 Aug 2014 03:46:06 PM EDT - Unplugged or turned off printer PDF is idle. enabled since Sun 17 Aug 2014 09:51:41 PM EDT
lpstat -a
Display only those printers that are currently accepting print requests. Output resembles the following:
Lexmark_Pro700_Series accepting requests since Mon 18 Aug 2014 03:46:06 PM EDT PDF accepting requests since Sun 17 Aug 2014 09:51:41 PM EDT
Note that printers that are currently powered off still accepts requests; these requests remain in the queue until the device is powered on, or the request is removed with lprm.
lpstat -d
Displays which printer is currently the default. Output resembles the following:
system default destination: Lexmark_Pro700_Series
lpstat -o
Display all active print jobs. Output resembles the following:
Rank Owner Job Files Total Size 1st hope 1 budget.txt 2315 bytes 2nd hope 2 /home/hope/docs/userlist.txt 5452 bytes 3rd hope 4 (standard input) 52954 bytes 4th hope 5 /tmp/vroAdm2/1 5827 bytes
Related commands
cancel — Cancels a print job under the System V operating system.lp — Print a file on the System V operating system.lpq — List the status of available printers.lpr — Submit print requests.lprm — Remove requests from the print queue.