命令行大全

lpadmin

瑞兹 发表于 2021-02-01 09:10浏览次数:

在类似Unix的操作系统上,lpadmin命令配置lp打印服务。

查看英文版

目录:

1 lpadmin 运行系统环境

2 lpadmin 描述

3 lpadmin 语法

4 lpadmin 例子

lpadmin 运行系统环境

Unix&Linux

lpadmin 描述

lpadmin配置由通用打印系统CUPS提供的打印机和类队列。它也可以用来设置服务器默认打印机或类。

-d-p-x选项之前指定时,-E选项在连接到服务器时强制加密。

命令的第一种形式(-d)将默认打印机或类设置为目标。除非用户用lpoptions命令另外指定,否则通过lp或lpr命令提交的后续打印作业将使用此目的地。

命令的第二种形式(-p)配置命名的打印机或类。其他选项如下所述。

命令的第三种形式(-x)删除打印机或类目标。将删除目的地中所有待处理的作业,而当前正在打印的任何作业都将中止。

lpadmin configures printer and class queues provided by the common printing system CUPS. It can also be used to set the server default printer or class.

When specified before the -d-p, or -x options, the -E option forces encryption when connecting to the server.

The first form of the command (-d) sets the default printer or class to destination. Subsequent print jobs submitted via the lp or lpr commands will use this destination unless the user specifies otherwise with the lpoptions command.

The second form of the command (-p) configures the named printer or class. The additional options are described below.

The third form of the command (-x) deletes the printer or class destination. Any jobs that are pending for the destination will be removed and any job that is currently printed will be aborted.

查看英文版

查看中文版

lpadmin 语法

lpadmin [ -E ] [-U username ] [ -h server[:port] ] -d destination 
lpadmin [ -E ] [-U username ] [ -h server[:port] ] -p destination [ -R name-default ] option(s) 
lpadmin [ -E ] [-U username ] [ -h server[:port] ] -x destination 

配置选项

以下选项配置打印机队列。

-c class 将命名的打印机添加到class中。如果不存在,则会自动创建。
-i interface 设置打印机的System V样式界面脚本。此选项不能与-P选项(PPD文件)一起指定,并且旨在为旧打印机驱动程序提供支持。
-m model 从型号目录或使用驱动程序界面之一为打印机设置标准的System V接口脚本或PPD文件。将-m选项与lpinfo命令一起使用,以获取受支持模型的列表。
-o cupsIPPSupplies = true-o cupsIPPSupplies = false 指定是否应报告IPP供应级别值。
-o job-k-limit =value 设置每用户配额的千字节限制。该值是整数的千字节;1 KB是1024字节。
-o job-page-limit =value 设置每用户配额的页面限制。该值是可以打印的整数页数。双面页计为两页。
-o job-quota-period =value 设置每个用户配额的会计期。整数秒。一天中有86,400秒。
-o job-sheets-default =banner
-o job-sheets-default =bannerbanner
设置用于打印作业的默认横幅页面。
-o名称=value 设置打印机的PPD选项。可以使用lpoptions命令的-l选项列出PPD选项。
-o name-default =value 设置目标的默认服务器端选项。可以默认设置任何打印时间选项,例如,“ -o cpi-default = 17 ”将默认的“ cpi”选项值设置17
-o port-monitor =name 设置二进制通信程序在打印时使用“ none ”,“ bcp ”或“ tbcp ”。默认程序是“ none ”。指定的端口监视器必须在打印机的PPD文件中列出。
-o printer-error-policy=name 设置打印机后端无法将作业发送到打印机时要使用的错误策略。名称必须是“ abort-job ”,“ retry-job ”,“ retry-current-job ”或“ stop-printer ”之一。对于打印机,默认错误策略是“ stop-printer ”,对于类,默认错误策略是“ retry-current-job ”。
-o printer-is-shared = [ true | false] 将目标设置为共享/已发布或未共享/未发布。共享/已发布的目的地由LAN上的服务器根据cupsd.conf中的浏览配置公开宣布,而未共享/未发布的目的地不会被宣布。默认值为“ true ”。
-o printer-op-policy =name 设置与目标关联的IPP操作策略。该名称必须在“策略”部分的cupsd.conf中定义。默认操作策略为“默认”。
-R name-default 从打印机删除命名的选项。
-r class class中删除命名的打印机。如果结果类为空,则将其删除。
-u allow:useruser,@group

-u deny:useruser,@group

-u allow:all

-u deny:none
在目标上设置用户级别的访问控制。以“ @ ”开头的名称被解释为UNIX组。后两种形式关闭用户级访问控制。
-v“ device-uri  设置打印机队列的device-uri属性。将-v选项与lpinfo命令一起使用,以获取受支持的设备URI和方案的列表。
-D“info 提供目的地的文字说明。
-E 启用目标并接受作业;这与在目的地上运行cupsacceptcupsenable程序相同。
-L“location 提供目的地的文本位置。
-P ppd-file 指定要与打印机一起使用的PostScript打印机描述文件。如果指定,此选项将覆盖-i选项(接口脚本)。
lpadmin [ -E ] [-U username ] [ -h server[:port] ] -d destination 
lpadmin [ -E ] [-U username ] [ -h server[:port] ] -p destination [ -R name-default ] option(s) 
lpadmin [ -E ] [-U username ] [ -h server[:port] ] -x destination 

Configuration Options

The following options configure the printer queue.

-c class Adds the named printer to class. If class does not exist it is created automatically.
-i interface Sets a System V style interface script for the printer. This option cannot be specified with the -P option (PPD file) and is intended for providing support for legacy printer drivers.
-m model Sets a standard System V interface script or PPD file for the printer from the model directory or using one of the driver interfaces. Use the -m option with the lpinfo command to get a list of supported models.
-o cupsIPPSupplies=true-o cupsIPPSupplies=false Specifies whether IPP supply level values should be reported.
-o job-k-limit=value Sets the kilobyte limit for per-user quotas. The value is an integer number of kilobytes; one kilobyte is 1024 bytes.
-o job-page-limit=value Sets the page limit for per-user quotas. The value is the integer number of pages that can be printed; double-sided pages are counted as two pages.
-o job-quota-period=value Sets the accounting period for per-user quotas. The value is an integer number of seconds; 86,400 seconds are in one day.
-o job-sheets-default=banner,
-o job-sheets-default=banner,banner
Sets the default banner page(s) to use for print jobs.
-o name=value Sets a PPD option for the printer. PPD options can be listed using the -l option with the lpoptions command.
-o name-default=value Sets a default server-side option for the destination. Any print-time option can be defaulted, e.g., "-o cpi-default=17" to set the default "cpi" option value to 17.
-o port-monitor=name Sets the binary communications program to use when printing, "none", "bcp", or "tbcp". The default program is "none". The specified port monitor must be listed in the printer's PPD file.
-o printer-error-policy=name Sets the error policy to be used when the printer backend is unable to send the job to the printer. The name must be one of "abort-job", "retry-job", "retry-current-job", or "stop-printer". The default error policy is "stop-printer" for printers and "retry-current-job" for classes.
-o printer-is-shared=[true|false] Sets the destination to shared/published or unshared/unpublished. Shared/published destinations are publicly announced by the server on the LAN based on the browsing configuration in cupsd.conf, while unshared/unpublished destinations are not announced. The default value is "true".
-o printer-op-policy=name Sets the IPP operation policy associated with the destination. The name must be defined in the cupsd.conf in a Policy section. The default operation policy is "default".
-R name-default Deletes the named option from printer.
-r class Removes the named printer from class. If the resulting class becomes empty it is removed.
-u allow:user,user,@group

-u deny:user,user,@group

-u allow:all

-u deny:none
Sets user-level access control on a destination. Names starting with "@" are interpreted as UNIX groups. The latter two forms turn user-level access control off.
-v "device-uri" Sets the device-uri attribute of the printer queue. Use the -v option with the lpinfo command to get a list of supported device URIs and schemes.
-D "info" Provides a textual description of the destination.
-E Enables the destination and accepts jobs; this is the same as running the cupsaccept and cupsenable programs on the destination.
-L "location" Provides a textual location of the destination.
-P ppd-file Specifies a PostScript Printer Description file to use with the printer. If specified, this option overrides the -i option (interface script).

查看英文版

查看中文版

lpadmin 例子

lpadmin -p LaserJet -E -v socket://10.1.1.1 -m laserjet.ppd

使用CUPS驱动程序文件laserjet.ppd添加位于网络位置10.1.1.1的名为Laserjet的打印机。

lpadmin -p LaserJet -E -v socket://10.1.1.1 -m laserjet.ppd

Add a printer named Laserjet which is at the network location 10.1.1.1, using the CUPS driver file laserjet.ppd.

查看英文版

查看中文版

发表评论
评论列表
共0条
点击加载更多