首页 > 系统相关 >Linux lp命令(-o选项,-d目标打印机,-p页码范围)

Linux lp命令(-o选项,-d目标打印机,-p页码范围)

时间:2023-10-27 22:46:37浏览次数:39  
标签:打印 作业 job lp Linux print 页码 page

 

原文主要介绍lp命令的参数和描述。常见命令包括:

lp filename(打印filename)

-d 打印机名称(指定打印机)

-P 1,2-5,6 (指定页码范围)

-o sides=two-sided-long-edge(选项,长边翻转,竖直打印)

-o number-up (指定一页几版)

……有趣的打印命令详见下文

lp命令原文:通过命令行,man lp得到:

NAME
lp - print files

SYNOPSIS 大纲;概要;梗概
lp
[ -E ]
[ -U username ]
[ -c ]
[ -d destination[/instance] ]
[ -h hostname[:port] ]
[ -m ] [ -n num-copies ]
[ -o option[=value] ]
[ -q priority ]
[ -s ]
[ -t title ]
[ -H handling ]
[ -P page-list ]
[ -- ]
[ file(s) ]

lp
[ -E ]
[ -U username ]
[ -c ]
[ -h hostname[:port] ]
[ -i job-id ]
[ -n num-copies ]
[ -o option[=value] ]
[ -q priority ]
[ -t title ]
[ -H handling ]
[ -P page-list ]

DESCRIPTION 描述;产品描述;说明;品名;产品说明
lp submits files for printing or alters a pending job.
提交要打印的文件或更改挂起的作业
Use a filename of "-" to force printing from the standard input.
使用文件名“-”强制从标准输入进行打印。

THE DEFAULT DESTINATION
默认目的地(默认打印机)

CUPS provides many ways to set the default destination.
提供了许多设置默认目标的方法。
The LPDEST and PRINTER environment variables are consulted first. If neither are set,
the current default set using the lpoptions(1) command is used, fol‐
lowed by the default set using the lpadmin(8) command.
OPTIONS 选项
The following options are recognized by lp:

-- Marks the end of options; use this to print a file whose name
begins with a dash (-).

-E Forces encryption when connecting to the server.

-U username
Specifies the username to use when connecting to the server.

-c This option is provided for backwards-compatibility only. On sys‐
tems that support it, this option forces the print file to be
copied to the spool directory before printing. In CUPS, print
files are always sent to the scheduler via IPP which has the same
effect.

-d destination
Prints files to the named printer.
将文件打印到指定的打印机
-h hostname[:port]
Chooses an alternate server.
选择备用服务器。
-i job-id
Specifies an existing job to modify.

-m Sends an email when the job is completed.

-n copies
Sets the number of copies to print.
设置要打印的份数
-o "name=value [ ... name=value ]"
Sets one or more job options. See "COMMON JOB OPTIONS" below.
设置一个或多个作业选项。请参阅下面的“常见工作选项”。
-q priority
Sets the job priority from 1 (lowest) to 100 (highest). The
default priority is 50.
将作业优先级从1(最低)设置为100(最高)。这个默认优先级为50。

-s Do not report the resulting job IDs (silent mode.)
不报告生成的作业ID(静默模式)
-t "name"
Sets the job name.
设置作业名称

-H hh:mm

-H hold

-H immediate

-H restart

-H resume
Specifies when the job should be printed. A value of immediate
will print the file immediately, a value of hold will hold the job
indefinitely, and a UTC time value (HH:MM) will hold the job until
the specified UTC (not local) time. Use a value of resume with
the -i option to resume a held job. Use a value of restart with
the -i option to restart a completed job.
指定打印作业的时间。值immediate将立即打印文件,
值hold将无限期保留作业,而UTC时间值(HH:MM)将保留作业直到指定的UTC
(非本地)时间。将resume的值与-i选项一起使用可恢复保留的工作。将值
restart与-i选项一起使用可重新启动已完成的作业。
-P page-list
Specifies which pages to print in the document. The list can con‐
tain a list of numbers and ranges (#-#) separated by commas, e.g.,
"1,3-5,16". The page numbers refer to the output pages and not
the document's original pages - options like "number-up" can
affect the numbering of the pages.
指定要在文档中打印的页面。列表可以包含数字和范围的列表(#-#),用逗
号分隔,例如“1,3-5,16”。页码指的是输出页面,而不是文档的原始页面,
“编号向上”之类的选项会影响页面的编号。

COMMON JOB OPTIONS 常见作业选项

Aside from the printer-specific options reported by the lpoptions(1)
command, the following generic options are available:
除了lpoptions(1)命令报告的打印机特定选项外,还提供以下通用选项:

-o collate=true
Prints collated copies.
打印已校对的副本

-o fit-to-page
Scales the print file to fit on the page.
缩放打印文件以适合页面。


-o job-hold-until=when
Holds the job until the specified local time. "when" can be
"indefinite" to hold the until released, "day-time" to print the
job between 6am and 6pm local time, "night" to print the job
between 6pm and 6am local time, "second-shift" to print the job
between 4pm and 12am local time, "third-shift" to print the job
between 12am and 8am local time, or "weekend" to print the job on
Saturday or Sunday.
将作业保留到指定的本地时间。“当“可”无限期“持有直到发布,”白天时间“
打印作业在当地时间早上6点到晚上6点之间,“晚上”打印作业在当地时间下
午6点到早上6点之间,“第二班”打印作业在当地时间下午4点到12点之间,
“第三班”打印作业在当地时间上午12点到8点之间,或“周末”在周六或周日
打印作业。


-o job-hold-until=hh:mm
Holds the job until the specified time in hours and minutes UTC.
将作业保留到指定的时间(UTC小时和分钟)。

-o job-priority=priority
Set the priority to a value from 1 (lowest) to 100 (highest),
which influences when a job is scheduled for printing. The
default priority is typically 50.
将优先级设置为1(最低)到100(最高)之间的值,这会影响计划打印作业的时间。
默认优先级通常为50。


-o job-sheets=name
Prints a cover page (banner) with the document. The "name" can be
"classified", "confidential", "secret", "standard", "topsecret",
or "unclassified".
打印包含文档的封面(横幅)。“名称”可以是“机密”、“机密”、“机密”、
“标准”、“绝密”或“非机密”。


-o job-sheets=start-name,end-name
Prints cover pages (banners) with the document.
打印带有文档的封面(横幅)。

-o media=size
Sets the page size to size. Most printers support at least the
size names "a4", "letter", and "legal".
将页面大小设置为“大小”。大多数打印机至少支持大小名称“a4”、“letter”和“legal”。


-o mirror
Mirrors each page.
镜像每页


-o number-up={2|4|6|9|16}
Prints 2, 4, 6, 9, or 16 document (input) pages on each output
page.
在每个输出页上打印2、4、6、9或16个文档(输入)页。

-o number-up-layout=layout
Specifies the layout of pages with the "number-up" option. The
"layout" string can be "btlr", "btrl", "lrbt", "lrtb", "rlbt",
"rltb", "tblr", or "tbrl" - the first two letters determine the
column order while the second two letters determine the row order.
"bt" is bottom-to-top, "lr" is left-to-right, "rl" is right-to-
left, and "tb" is top-to-bottom.
使用“数字向上”选项指定页面的布局。“layout”字符串可以是“btlr”、“btrl”
、“lrbt”、“lrtb”、“rlbt”、“rltb”、“tblr”或“tbrl”-前两个字母确定列顺序
,后两个字母确定行顺序bt是从下到上,“lr”是从左到右,“rl”是从右到左,
“tb”是从上到下。
-o orientation-requested=4
Prints the job in landscape (rotated 90 degrees counter-clock‐
wise).
横向打印作业(逆时针旋转90度)。


-o orientation-requested=5
Prints the job in landscape (rotated 90 degrees clockwise).
横向打印作业(顺时针旋转90度)。


-o orientation-requested=6
Prints the job in reverse portrait (rotated 180 degrees).
以反向纵向打印作业(旋转180度)。
-o outputorder=reverse
Prints pages in reverse order.
按相反顺序打印页面。


-o page-border=border
Prints a border around each document page. "border" is "double",
"double-thick", "single", or "single-thick".
在每个文档页周围打印边框。““边框”是“双层”、“双层厚”、“单层”或“单层厚”。
-o page-ranges=page-list
Specifies which pages to print in the document. The list can con‐
tain a list of numbers and ranges (#-#) separated by commas, e.g.,
"1,3-5,16". The page numbers refer to the output pages and not
the document's original pages - options like "number-up" can
affect the numbering of the pages.
指定要在文档中打印的页面。列表可以包含数字和范围的列表(#-#),用逗
号分隔,例如“1,3-5,16”。页码指的是输出页面,而不是文档的原始页面选项
(如“向上编号”)可能会影响页面的编号。

-o sides=one-sided
Prints on one side of the paper.
在纸的一面打印。


-o sides=two-sided-long-edge
Prints on both sides of the paper for portrait output.
在纸张的两面打印,以便输出肖像。


-o sides=two-sided-short-edge
Prints on both sides of the paper for landscape output.
打印在纸张的两面,用于横向输出。


CONFORMING TO 遵循
Unlike the System V printing system, CUPS allows printer names to con‐
tain any printable character except SPACE, TAB, "/", or "#". Also,
printer and class names are not case-sensitive.
与System V打印系统不同,CUPS允许打印机名称包含除空格、制表符、“/”或“#”
以外的任何可打印字符。此外,打印机和类名不区分大小写。
The -q option accepts a different range of values than the Solaris lp
command, matching the IPP job priority values (1-100, 100 is highest
priority) instead of the Solaris values (0-39, 0 is highest priority).
q选项接受的值范围与Solaris lp命令不同,它匹配的是IPP作业优先级值
(1-100100是最高优先级),而不是Solaris值(0-39,0是最高优先级)。


EXAMPLES 示例

Print two copies of a document to the default printer:
将文档的两个副本打印到默认打印机:
lp -n 2 filename

Print a double-sided legal document to a printer called "foo":
将双面法律文件打印到名为“foo”的打印机上:
lp -d foo -o media=legal -o sides=two-sided-long-edge filename

Print a presentation document 2-up to a printer called "foo":
将演示文档2-up打印到名为“foo”的打印机上:
lp -d foo -o number-up=2 filename

SEE ALSO 另请参见

cancel(1), lpadmin(8), lpoptions(1), lpq(1), lpr(1), lprm(1),
lpstat(1), CUPS Online Help (http://localhost:631/help)

标签:打印,作业,job,lp,Linux,print,页码,page
From: https://www.cnblogs.com/sunalways/p/17793275.html

相关文章

  • Linux mkdir命令:创建目录(文件夹)
    mkdir命令,是makedirectories的缩写,用于创建新目录,此命令所有用户都可以使用。mkdir命令的基本格式为:[root@localhost~]#mkdir[-mp]目录名-m选项用于手动配置所创建目录的权限,而不再使用默认权限。-p选项递归创建所有目录,以创建/home/test/demo为例,在默认情况下,你需要......
  • Linux p11 时间日期指令
    【学习课程】:【【小白入门通俗易懂】2021韩顺平一周学会Linux】https://www.bilibili.com/video/BV1Sv411r7vd/?p=14&share_source=copy_web&vd_source=2c07d62293f5003c919b2df9b2e0549e时间日期指令date指令显示当前日期基本语法:date,显示当前时间date+%Y,显示当前......
  • linux 如何开机的时候自动挂载硬盘
    编辑/etc/fstab文件该文件的主要作用是在系统启动时自动挂载文件系统。当系统启动时,Linux会读取/etc/fstab文件中的信息,并根据其中的配置将指定的文件系统挂载到指定的挂载点上sudovim/etc/fstab#示例/dev/sdb1/mnt/dataext4defaults00#我的/dev/sda/media/ka......
  • linux面试题总结(腾讯)
    1、运维会经常写shell脚本来执行任务,脚本的健壮性直接关系生产环境的稳定性,对于提升shell脚本的健壮性,有哪些常见的方法?2、日志里出现unabletoattachtosharedmemory,可能的原因是什么,如何解决?3、如何判断程序是否存在内存泄露?4、rm删除文件后空间没有释放,可能的原因和解决......
  • Linux 的性能调优的思路
    Linux操作系统是一个开源产品,也是一个开源软件的实践和应用平台,在这个平台下有无数的开源软件支撑,我们常见的apache、tomcat、mysql等。开源软件的最大理念是自由、开放,那么Linux作为一个开源平台,最终要实现的是通过这些开源软件的支持,以最低廉的成本,达到应用最优的性能。因此,谈......
  • linux系统 基本权限ACL读书笔记
    当你作为一个Linux初学者探索文件权限和ACL(AccessControlLists)时,了解getfacl和setfacl命令将帮助你更好地管理文件和目录的权限。以下是一些关于这两个命令的读书笔记:getfacl命令getfacl命令用于获取文件或目录的ACL信息。ACL允许你在标准UNIX权限之外更精细地控制访问。以下......
  • delphi 运行时动态设置控件(类)属性值
    运行时动态设置控件(类)属性值代码运行时根据控件名称设置Alignment属性值usesSystem.Rtti;procedureTForm1.Button1Click(Sender:TObject);varvComponent:TComponent;vRttiCtx:TRttiContext;vRType:TRttiType;vProp:TRttiProperty;v:TValue;begin......
  • Linux文件IO操作 (系统调用函数)
    1.打开和关闭文件1.1open#include<unistd.h>#include<fcntl.h>intopen(constchar*pathname,intflags)/*pathname:打开文件的路径名(相对、绝对)flags:打开文件的方式(O_RDONLY|O_WRONLY|O_RDWR)---<fcntl.h>return:返回一个文件描述符或-1*/......
  • 一文彻底弄懂Linux-Shell编程
    一、Shell 编程之条件结构1、Shell 条件测试语法test 测试表达式利用test命令进行条件测试表达式, test命令与测试表达式之间至少有一个空格[测试表达式]通过[]中括号进行条件测试表达式, []中括号边界与测试表达式之间至少有一个空格[[测试表达式]]通过[[]]双中括......
  • linux 更换java 版本
    1查看java版本ls/usr/lib/jvm/2设置java版本(根据提示的编号)sudoupdate-alternatives--configjava3设置环境变量sudonano/etc/environment然后添加以下内容:JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"PATH=$JAVA_HOME/bin:$PATH注意,JAVA_HOME需要指向您希望使......