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

What is the use of the linux offline print command

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "what is the use of linux offline printing command". In daily operation, I believe that many people have doubts about the use of linux offline printing command. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "what is the use of linux offline printing command?" Next, please follow the editor to study!

The spooling printing method is used under Linux. When the user needs to print a file, the file is not sent directly to the printer, but to the spool directory, and then the data is sent to the printer by a background process responsible for printing.

Linux defines a print buffer for each printer, and the printer daemon often scans the print buffer to see if there are any new files to print. If it exists, the files in the buffer are printed in first-in-first-out order.

In addition to printing on local printers, Linux systems can also print remotely through network printers.

For linux offline print commands

The Linux system provides a set of commands for printing. In general, the print command uses the default printer; if the user defines the PRINTER environment variable, the print command uses the printer defined by this variable; in addition, the user can specify the printer to use on the command line.

Linux offline print command

Lpr command

The lpr command is the linux offline print command, which places the print job in the print buffer queue. Each printer specified for the Linux system has its own print buffer directory, and the minfree file in each directory specifies the number of disk blocks on which the print file is saved.

Lpr communicates with the lpd daemon, lpd scans / etc/printcap files, queries the corresponding cache directory of the printer, and then lpd controls printing, sending the data to the actual printer. If no file is specified, lpr uses standard input.

The format of the lpr command is:

Lpr [- P printer] [# num] [other options] [name … ]

The options in the command have the following meanings:

-P specifies the printer. If this option is not used, the default printer or the printer specified by the environment variable PRINTER is used.

-m send email after printing.

-# num prints Num copies.

Lpq command

Lpq is a buffer queue check command that checks the print file in the buffer through lpd, reporting the status of the specified job or all jobs for the specified user. The lpq command with no arguments displays any jobs now in the queue. An important piece of information in the display of the lpq command is the job identification number (job ID), which identifies a specific job. If the user wants to cancel a pending job, he must specify this identification number in the command.

The format of the lpq command is:

Lpq [- l] [- P printer] [job #] [user... ]

The options in the command have the following meanings:

-P specifies a printer, otherwise use the default printer or the printer specified by the environment variable PRINTER.

-l prints information about all the files that make up the job.

For each job submitted, lpq reports information such as the user name, the level in the queue, the files that make up the job, the job identity, and the total size.

Lprm command

The lprm command is used to delete print jobs from the buffer queue, and users can use this command to delete one or more print jobs of their own from the buffer queue.

The format of the lprm command is:

Lprm [- P printer] [-] [job #] [user... ]

The options in the command have the following meanings:

-P specifies a printer, otherwise use the default printer or the printer specified by the environment variable PRINTER.

-Delete all of the user's print jobs.

User deletes jobs from the queue that belong to user user (only superusers can do this).

Job # Delete a print job by specifying the job number #, which can be obtained through the lpq command, such as:

$lpq-l

Lst:ken [job # 013ucbarpa]

(standard input) 100 bytes

$lprm 13

Linux offline print command buffer directory

For printing, there is a very important directory, the print buffer directory, where the data to be printed is concentrated before it is printed. Usually a printer corresponds to a print buffer directory, which makes it easier to manage the printer. For example, the system uses / var/spool/lpd as the main print buffer, and each individual printer has a directory with the same name as this printer under the main print buffer. Therefore, the printer named ps_nff has / var/spool/lpd/ps_nff as its print buffer directory.

At this point, the study on "what is the use of linux offline printing commands" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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