在Ubuntu中,我想使用命令行来获取打印作业的状态。 当我使用lp将作业发送到打印机时,我可以在任务栏小程序中看到打印作业的状态。 例如,当我将作业发送到closures的打印机时,我看到一个表示“待处理”的作业。
但是,当我运行lpstat -t时,我所看到的是以下内容:
scheduler is running system default destination: Brother_MFC-7340 device for BRFAX: usb:/dev/usb/lp0 device for Brother_MFC-7340: usb://Brother/MFC-7340?serial=000G9N299107 device for MFC-7340: usb://Brother/MFC-7340?serial=000G9N299107 device for MFC7340: usb://Brother/MFC-7340?serial=000G9N299107 BRFAX accepting requests since Tue 03 Dec 2013 10:42:29 AM CST Brother_MFC-7340 accepting requests since Fri 06 Dec 2013 04:11:28 PM CST MFC-7340 accepting requests since Fri 06 Dec 2013 04:11:28 PM CST MFC7340 accepting requests since Fri 06 Dec 2013 04:11:28 PM CST printer BRFAX is idle. enabled since Tue 03 Dec 2013 10:42:29 AM CST File "/usr/lib/cups/filter/brfaxfilter" has insecure permissions (0100777/uid=0/gid=0). printer Brother_MFC-7340 disabled since Fri 06 Dec 2013 04:11:28 PM CST - Unplugged or turned off printer MFC-7340 disabled since Fri 06 Dec 2013 04:11:28 PM CST - Unplugged or turned off printer MFC7340 disabled since Fri 06 Dec 2013 04:11:28 PM CST - Unplugged or turned off Brother_MFC-7340-14 jnankin 77824 Tue 10 Dec 2013 06:46:52 PM CST Brother_MFC-7340-15 jnankin 305152 Tue 10 Dec 2013 07:30:13 PM CST
如何让lpstat打印“待处理”或等同于此作业? 同样,如果我有作业string(在本例中为Brother_MFC-7340-15),如何查看作业是否已完成或失败?
man lpstat
会显示很多事情,并伴随着:
-t Prints all status information. This includes all the information obtained
对于队列状态,你可以尝试使用:
-W display the status of all print queues in wide format
要么
-p -l会显示很长的工作列表。
另外“lpq”对打印机作业队列信息很有用。
好…
lpstat -W completed显示已完成的作业。
lpstat -W completed printerName显示打印机“printerName”的完成作业
lpstat命令默认显示未完成(挂起)的作业…
lpstat:错误 – 在'-W'选项后需要“完成”,“未完成”或“全部”!
所以有一种方法可以按下命令选项来获得你所需要的。 看看http://your.ip:631上的本地CUPS网页界面是否会更容易?因为这会提供更多的实时状态?