P. 1
Linux Certification Bible

Linux Certification Bible


|Views: 2.327|Likes:
Publicado porMarcelo

More info:

Published by: Marcelo on Dec 18, 2008
Direitos Autorais:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





The administrator can use several commands to manage and use print queues and
spooling. Each command has a variety of options to help maintain your printing


The line printer control (lpc) command is used to control the operation of the line
printer system. For each printer configured in /etc/printcap, the lpccommand can
perform a variety of functions:

✦lpc abort: Immediately terminates an active spooling daemon on the local
host and then disables printing (preventing new daemons from being started
by lpr) for the specified printers.

✦lpc clean: Removes any temporary files, data files, or control files that can’t
be printed from the specified printer queue on the local machine.

✦lpc disable: Turns the specified printer queues off. This prevents lpr from
entering new printer jobs into the queue.

✦lpc enable: Enables spooling on the local queue for the listed printers. This
allows lpr to put new jobs in the spool queue.

✦lpc up: Enables the print queues and starts a new printer daemon; also
undoes the effects of the lpc downcommand.

✦lpc down: Turns the specified printer queue off, disables printing and puts a
message in the printer status file. The message doesn’t need to be quoted—
the remaining arguments are treated like echo. lpq indicates that the printer is
down and prints the status message.

✦lpc exit/quit: Exits from lpc.

164881-6 ch11.F 11/12/01 8:30 AM Page 365

366Part IV ✦Administration

✦lpc restart: Attempts to start a new printer daemon. This is useful when an
abnormal condition causes the daemon to die unexpectedly, thus leaving jobs
in the queue. When this condition occurs, lpq reports that no daemon is pre-
sent. If the user is the super-user, try to abort the current daemon first (for
example, kill and restart a stuck daemon).

✦lpc status: Displays the status of daemons and queues on the local


✦lpc stop: Stops a spooling daemon after the current job completes and dis-
ables printing.

✦lpc topg: Places the jobs in the order listed at the top of the printer queue.


To simplify printer queue administration, you can also use the lpqcommand. This
command allows you to directly see what jobs are currently in a printer queue.

Entering the lpqcommand on its own provides information from a command
prompt about the current printer queues. The lpqcommand normally displays
information about who queued the print job, where it is in the queue, the files being
printed, and the total size of the files. The -l option displays more information about
each entry in the printer queue. Usually only one line of information is displayed.

You can specify a specific printer by using the lpq -P[printer name]command.


The line printer remove command, or lprm, removes print jobs from the printer
queue. You need to know the print job ID to be able to remove its print jobs, but if
you are logged in as root, you can remove all jobs for a printer by using the follow-
ing command syntax:

lprm [-Pprinter_name] [-] [job_ID ...] [username ...]

You can also remove a particular printer’s jobs by using the -P option. The following
command removes all print jobs queued on the printer hplj by the user who is issu-
ing the command, or all print jobs for that printer if the command is issued by root:

lprm -Phplj -

Most versions of Linux come with their own print management tools, but its help-
ful to know the standard Unix way of setting up print spools and queues.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->