593-594.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 74 行

HTML
74
字号
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Devices</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=33//-->

<!--PAGES=593-594//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="591-593.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="595-597.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P>When used without any arguments, <TT>lpc</TT> prompts you for a command. The following are several valid <TT>lpc</TT> commands and their arguments (a vertical bar indicates a choice of arguments):</P>

<DL>

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>abort <I>printer_name</I>| all</TT> This is similar to the <TT>stop</TT> command except it doesn&#146;t allow any print job that is currently being printed to finish before stopping the printer. When used with the <TT>all</TT> argument, all printers are stopped. Any job that is abnormally terminated by the <TT>abort</TT> command is requeued when the printer is started again. See the <TT>stop</TT> command for more details about the printer daemon and lock files.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>clean <I>printer_name</I>| all</TT> This removes all print jobs that are queued, including any active print jobs. In many cases, the currently printing job proceeds normally because it has been passed to the printer daemon or the printer&#146;s buffer. All other jobs are removed, though. If the <TT>all</TT> argument is used, all printers have their print queues cleaned.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>disable <I>printer_name</I>| all</TT> This disables the spooling of print requests to the printer (or all printers, depending on the argument). Any jobs that are already queued are unaffected. Any user trying to send a print job to the disabled printer receives a message indicating that the printer is disabled and the print job is refused. Printers are enabled and disabled through changes in the <TT>lock</TT> file in the spool directory.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>down <I>printer_name message</I></TT> This is used to take a printer completely offline, usually for an extended period. If a message is included, it can be as long as you want. It is placed in the <TT>status</TT> file in the spool directory and displayed to users trying to queue to the printer. The <TT>down</TT> command is usually used when a printer has serious problems and must be removed from the system for more than a day.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>enable <I>printer_name</I>| all</TT> This enables the spooling of print requests to the printer or all printers.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>exit</TT> This exits from <TT>lpc</TT> (the same as <TT>quit</TT>).

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>help</TT> or<TT>?</TT> This shows a short list of all <TT>lpc</TT> commands. If an argument is supplied, it displays a one-line description of that command (such as <TT>help abort</TT>).

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>quit</TT> This exits from <TT>lpc</TT> (the same as <TT>exit</TT>).

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>restart <I>printer_name</I>| all</TT> This restarts the printer daemon and is usually used after the printer daemon has died for an inexplicable reason (which the BSD printer daemons tend to do). If the argument <TT>all</TT> is supplied, all printer daemons are restarted.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>start <I>printer_name</I></TT> This starts the printer, allowing it to print requests. This command starts the printer queue daemon for that printer.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>status <I>printer_name</I></TT> This displays the printer name, whether it has the spool queue enabled, whether printing is enabled, the number of entries in the print queue, and the status of the daemon for that printer. If there are no entries in the queue, no printer daemon will be active. However, if there are entries in the queue and the printer daemon shows as <TT>no daemon present</TT>, the daemon has died and must be started again with the <TT>restart</TT> command.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>stop <I>printer_name</I></TT> This stops the printer. Print requests can still be spooled, but they are not printed until the printer is started. If a job is being printed when the <TT>stop</TT> command is issued, the job completes the print process and then stops printing. The <TT>start</TT> and <TT>stop</TT> commands alter the contents of the lock file in the print spool directories. The <TT>stop</TT> command also kills the daemon for spooling to that printer.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>topq <I>printer_name print_ID</I></TT> This moves the print request with <TT><I>print_ID</I></TT> to the top of the print queue.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>topq <I>printer_name username</I></TT> This moves all print requests owned by <I>username</I> to the top of the queue. (This is very handy for system administrators who don&#146;t want to wait!)

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>up <I>printer_name</I></TT> This is used to reactivate a printer that was taken down. See the <TT>down</TT> command for more information.

</DL>

<P>The <TT>lpc</TT> utility isn&#146;t very user-friendly, but it&#146;s the only way to handle printers and their queues in Linux. Several front-end menu-driven utilities are beginning to appear that simplify this task.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="591-593.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="595-597.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?