Commands

Commands

lpc

[command [argument ]]

This command is used by root to manage the line printer system. If called with no arguments, lpc will supply an interactive prompt, otherwise it will interpret command line arguments as interactive commands. Note that it is effective only on printers specified in /etc/printcap.

Example: To invoke lpc from the command line and then use it to disable the print queue associated with lp1, use

lpc

lpc> disable lp1

? [command ...], help [command ...]

This command outputs a short description of the specified command, or, if none is specified, a list of available commands.

abort { all | printer }T

This command terminates spooling daemon on the local host and disable printing on the specified printer.

clean { all | printer }

This command removes any control files, temporary files, or data files that may exist on the local printer queue(s).

disable { all | printer }

This command prevents new printer jobs from being entered by lpr.

down { all | printer } message ...

This command brings the specified printers down. (Turn off the queue, disable printing, and put message in the printer status file.)

enable { all | printer }

This command allows new jobs to be entered into the spool queue.

exit, quit

This command is used to exit from lpc.

restart { all | printer }

This command tries to restart the printer daemon, possibly (if user is superuser) killing the current daemon.

start { all | printer }

This command is used to start a spooling daemon and to enable printing for the listed printer(s).

status { all | printer }

This command is used to display the status of queues and daemons on the local machine.

stop { all | printer }

This command is used after current job is completed, to halt the spooling daemon and to disable printing.

topq printer [jobnum ... ] [user ... ]

This command puts the jobs (in the order listed) at the top of the print queue.

up { all | printer }

This command activates everything and starts a new print daemon.

lpd

[-l] [port#]

lpd is the line printer daemon. Normally, this command is invoked at boot time from the rc file. It consults the /etc/printcap file to learn about existing printers, and then handles print requests. Its duties include handling print requests, transferring files to the spooling area, and removing jobs from the queue.

Example: This daemon is usually invoked by an rc script. To start lpd with logging, type the following line:

lpd -l &

-l

Log all valid print requests (primarily used for debugging).

port#

Specify the Internet port number used to meet with other processes.

The daemon relies on automatically generated cf (configuration) files that specify output formatting information. The files begin with "cf" and use the following set of control characters prepended to each line to tell lpd what to do:

J

Job Name. String to be used for the job name on the burst page.

C

Classification. String to be used for the classification line on the burst page.

L

Literal. The line contains identification information from the password file and causes the banner page to be printed.

T

Title. String to be used as the title for pr(1).

H

Host Name. Name of the machine where lpr was invoked.

P

Person. Login name of the person who invoked lpr. This is used to verify ownership by lprm.

M

Mail. Used to send email to the specified user when the current print job completes.

f

Formatted File. Name of a file to print that is already formatted.

l

Formatted File. Like "f," but passes control characters and does not make page breaks.

p

Name of File. Name of a file to print using pr(1) as a filter.

t

Troff File. The file contains troff(1) output (cat phototypesetter commands).

n

Ditroff File. The file contains device independent troff output.

r

DVI File. The file contains Tex l output DVI format from Standford.

g

Graph File. The file contains data produced by plot(3).

c

Cifplot File. The file contains data produced by cifplot.

v

Raster Image. The file contains a raster image.

r

Text Data. The file contains text data with FORTRAN carriage-control characters.

1

Troff Font R. Name of the font file to use instead of the default.

2

Troff Font I. Name of the font file to use instead of the default.

3

Troff Font B. Name of the font file to use instead of the default.

4

Troff Font S. Name of the font file to use instead of the default.

W

Width. Used to change the page width (in characters) used by pr(1) and the text filters.

I

Indent. Used to specify the number of ASCII characters needed to indent the output.

U

Unlink. Used to name the file that needs to be removed upon completion of printing.

N

File Name. Used to specify the name of the file that is being printed (or a blank for the standard input, when lpr is invoked in a pipeline).

lpq

[-l] [-Pprinter] [job # ] [user ]

Looks at the spooling area and reports on the status of the indicated job. If no job is specified, lpq reports on the whole queue. All arguments other than -P and -l are interpreted as user names or print job numbers.

Example: To get verbose information on the current print jobs for lp10, use

lpq -Plp10 -l

-P

Specified Printer. Used to tell lpq to look only at the specified printer.

-l

Long List. With this option, lpq will print information about each file in the job. (Normally, output is restricted to a single line.)

lpr

[-Pprinter] [-#num] [-C class] [-J job] [-T title] [-U user] [-i [numcols]] [-1234 font] [-wnum] [-cdfghlnmprstv] [file ]

lpr sends a request to a spooling daemon to print the specified files when a printer becomes available.

Example: To print two copies (#2) of the file stuff.out to printer lp1, use

lpr -Plp1 -#2 stuff.out

Nonstandard text files can be printed using the following options:

-c

Print data that is in cifplot format.

-d

Print data that is in tex DVI format.

-f

Assume the first character of each line is a FORTRAN carriage-control character.

-g

Print data that is in standard plot format.

-l

Allow printing of control characters; does not recognize page breaks.

-n

Print data that was formatted by ditroff.

-p

Use pr(1) to format the files (equivalent to print).

-t

Print data that was formatted by troff.

-v

Print raster image data formatted for printers like the Benson Varian.

These options apply to the handling of the print job:

-P

Send output to the specified printer.

-h

Do not include the burst page in the output.

-m

Send email when job is completed.

-r

Remove the file upon completion of the project.

-s

Use symbolic links rather than copying files to the spool directory.

-# num

Print the specified number of copies.

-[1234]font

Mount the specified font on font position i.

-C class

Use the specified classification on the burst page.

-J job

Use the specified job name on the burst page.

-T title

Use the specified title, instead of the file name.

-U user

Print the specified user name on the burst page.

-i [numcols]

Indent the output by the specified number of columns.

-wnum

Use the specified page width.

lprm

[-Pprinter] [-] [job # ] [user ]

Removes the specified jobs from the print queue.

Example: To remove job 43 from printer lp1, use

lprm -Plp1 43

graphics/tip.gif

Job numbers may be obtained via the lpq command.

 

-Pprinter

Specify the queue from which the file is to be removed.

-

Remove all the jobs owned by the current user. If user is superuser, remove all the files in the specified queue.

User

Remove all the jobs belonging to the specified user (valid only for superuser).

job#

Remove the specified job from the queue. (Job numbers may be obtained via lpq.)

pr

[OPTION] [FILE]

This option is used to format and print a file. The formatting includes a 5-line header (2 blank lines, a line with the date, the file name, and the page count, and then 2 more blank lines), a 5-blank line footer. Line widths are truncated to 72 columns.

Note that this command does not by itself send files to a printer, only to standard output.

Example: To print the file skinny.txt with a width of 50 columns (-w option), use

pr -w 50 skinny.txt

+FIRST_PAGE[:LAST_PAGE]

Specify the start page, or, if LAST_PAGE is included, a page range.

-COLUMN

Produce output of the specified COLUMN width.

-a

Print columns across, rather than down.

-c

Include control characters in the output.

-d

Format the output double spaced.

-e[IN-TABCHAR[IN-TABWIDTH]]

Expand tabs to spaces on input.

-f, -F

Separate output pages with a form feed.

-h HEADER

Use the specified header string, rather than the file name as a header.

-i[OUT-TABCHAR[OUT-TABWIDTH]]

Replace spaces with tabs on output.

-j

Merge lines of full length.

-l PAGE_LENGTH

Use the specified page length.

-m

Merge print several files. Print one file per column. (May be used with -s[SEPARATOR].)

-n[NUMBER-SEPARATOR[DIGITS]]

Precede each column with a line number.

-N LINE_NUMBER

Use the specified value as the starting line number.

-o N

Set the left margin at the specified number of spaces.

-r

Suppress warning messages when a file cannot be opened.

-s[SEPARATOR]

Use the specified separator between columns.

-t

Suppress header and footer information. Do not pad bottoms of pages with blanks.

-T

Suppress header and footer information. Suppress form feeds.

-v

Output unprintable characters in backslash octal notation.

-w PAGE_WIDTH

Use the specified page width.

tunelp

<device> [-i <IRQ> | -t <TIME> | -c <CHARS> | -w <WAIT> | -a [on|off] | -o [on|off] | -C [on|off] | -r | -s | -q [on|off] ]

tunelp allows the user to set parameters for the specified line printing devices.

Example: To set the printer driver /dev/lp1 to use IRQ 10 (-i options), use

tunelp /dev/lp1 -i 10

-i <IRQ>

Use the specified IRQ for the specified parallel port.

-t <TIME>

Specify the time (in jiffies) to wait if the printer doesn't take a character for the number of tries dictated by the -c parameter.

-c <CHARS>

Specify the number of times to try to output a character before going to sleep. For most printers, 120 is a reasonable value, but the default is 250 because some printers require that much.

-w <WAIT>

Busy loop counter for the strobe signal. There is an increase for use with printers that demand a long strobe, also may help when printing via long cables.

-a [on|off]

Toggle whether or not to abort on error. (Default is off.)

-o [on|off]

Check for "out of paper" and other errors when using open() call.

-C [on|off]

Extra careful error checking. Very useful for printers that will accept jobs even when powered off.

-s

Return the current printer status.

-r

Reset the port.

-q [on|off]

Toggle printing the current IRQ setting.

 



Linux Desk Reference
Linux Desk Reference (2nd Edition)
ISBN: 0130619892
EAN: 2147483647
Year: 2000
Pages: 174
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net