Printer configuration in Linux

Source: Internet
Author: User
Article Title: printer configuration in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

In Linux, The spooling printing method is used. When you need to print a file, the file is not directly sent to the printer, but to the spool directory, A background process responsible for printing then sends the data to the printer.

Linux defines a print buffer for each printer. The printer daemon often scans the print buffer to check whether new files are to be printed. If it exists, print the files in the buffer in the FIFO order.

In addition to printing on a local printer, Linux can also print data remotely through a network printer.

Command Used for Printing

Linux provides a set of printing commands. 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, you can also specify the printer to use on the command line.

Lpr command

The lpr command is an offline printing command that stores 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 that store the print files.

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

The format of the lpr command is:

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

The meanings of the options in the command are as follows:

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

-Send an email after m is printed.

-# Print num copies.

Lpq command

Lpq is a Buffer Queue check command. It checks print files in the buffer zone through lpd and reports the status of a specified job or all jobs of a specified user. The lpq command without any parameters shows any job in the queue. An important information in the display result of The lpq command is the job ID, which identifies a specific job. If you want to cancel a suspended job, you must specify this ID number in the command.

The format of the lpq command is:

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

The meanings of the options in the command are as follows:

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

-L print the information of all the files that constitute the job.

For each submitted job, The lpq report username, the level in the queue, the file that makes up the job, the job ID, and the total size.

 

[1] [2] Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.