Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux basic command-lpr print file

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Lpr

The lpr instruction is used to print the file, and if no file name is specified, the contents are read from standard input. CUPS provides many ways to set default goals. First query the "LPDEST" and "PRINTER" environment variables. If not, the current default set of the lpoptions (1) command is used, and then the default setting is made using the lpadmin (8) command.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora, openSUSE, SUSE.

1. Grammar

Lpr [- E] [- H server [: port]] [- U username] [- P destinations [/ instance]]

[- # num-copies [- h] [- l] [- m] [- o option [= value]] [- p] [- Q] [- r] [- C/J/T title] [file (s)]

2. Command list

Command

Description

-E

Use encryption mode

-H

Specify a remote print server

-C |-J |-T "name"

Set the print task name

-P destination [/ instance]

Specify the printer name

-U username

Set alias

-# copies

Set the number of copies to be printed from 1 to 100.

-h

Turn off banner printing

-l

The specified file has been formatted and should not be filtered when sent

-m

Send an email after the print is completed

-o option [= value]

Set options for job

-p

Specifies that the file should be formatted

-Q

Waiting for printing

-r

After printing, the file is deleted

3. Examples

Print the specified file

[root@localhost /] # lpr-C P1 / weijie/4.c / / print file, set the name of the print

[root@localhost /] # lpq / / View print queue

Printer01 is ready and printing

Total size of sequential owner job file

Active root 2 5.c 1024 bytes

1st root 3 P1 1024 byt

[root@localhost /] #

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report