コマンドラインツールを使用して、プリンターの説明やプリンターの場所などのプリンター情報を表示するにはどうすればよいですか?
lpstat -t
は、プリンターの名前、クラス、およびデバイスをリストしますが、プリンターの説明や場所はリストしません。 httpまたはGUIインターフェイスを使用せずにこの情報を取得する方法はありますか?
この情報はlpstat -l -p printername
で取得できます。
[root@Valley ~]# lpstat -l -p zebra2
printer zebra2 is idle. enabled since Tue Jun 8 15:50:35 2010
Form mounted:
Content types: any
Printer types: unknown
Description: Zebra 105SL in shipping
Alerts: none
Location: Shipping
Connection: direct
On fault: no alert
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner required
Charset sets:
(none)
Default pitch:
Default page size:
Default port settings:
これはもう少しグローバルです。すべてがgrepステートメントを排除するからです。
for i in $( lpstat -v | awk '{ print $3 }' | tr ':' ' ' ) ; do lpstat -l -p $i | grep 'printer\|Location' ; done