⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 595-597.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<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=595-597//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

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

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

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

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading11"></A><FONT COLOR="#000077">Managing the Printer Queue with lpq and lprm</FONT></H4>

<P>Several commands help you administer the printer queue specifically, instead of relying on the <TT>lpc</TT> command. Two tasks are commonly required by a system administrator: displaying the current queue and removing print jobs in a queue.</P>

<P>To display the current print queue for any printer, use the <TT>lpq</TT> command. It has the following syntax:</P>

<!-- CODE SNIP //-->

<PRE>

lpq [-l] [-P<I>printer_name</I>] [<I>job_ID</I> &#133;] [<I>username</I> &#133;]

</PRE>

<!-- END CODE SNIP //-->

<P>With no arguments at all, <TT>lpq</TT> displays information about the current printer queues. The <TT>lpq</TT> command 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 <TT>-l</TT> option displays more information about each entry in the printer queue. Usually, only one line of information is displayed.</P>

<P>A specific printer can be displayed with the <TT>-P</TT> option, followed by the printer&#146;s name. If no name is supplied, the default system printer is displayed. If one or more <TT><I>job_ID</I></TT>s or <TT><I>username</I></TT>s is provided, only information about the job or jobs queued by the user is shown.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Note:&nbsp;&nbsp;</B><BR>Because users can&#146;t access the Linux printer spooling directories, they can remove queued print jobs only with the <TT>lprm</TT> command. If you are a system administrator, you might want to let all system users know how to use this command to keep unwanted print jobs from printing.<HR></FONT>

</BLOCKQUOTE>

<P>The <TT>lprm</TT> command is used to remove files from a printer queue. This command is often mistyped as <TT>lpr</TT>, which doesn&#146;t remove the file from the queue. To use <TT>lprm</TT>, you must know the print job ID; or, if you are logged in as <TT>root</TT>, you can remove all jobs for a particular printer. The syntax of the <TT>lprm</TT> command is as follows:</P>

<!-- CODE SNIP //-->

<PRE>

lprm [-P<I>printer_name</I>] [-] [<I>job_ID</I> &#133;] [<I>username</I> &#133;]

</PRE>

<!-- END CODE SNIP //-->

<P>If the single-hyphen argument is used, <TT>lprm</TT> removes all jobs owned by the user who issues the command. If you are logged in as <TT>root</TT>, all print jobs are removed. A particular printer&#146;s jobs can be removed by using the <TT>-P</TT> option. For example, the command</P>

<!-- CODE SNIP //-->

<PRE>

lprm -Phplj -

</PRE>

<!-- END CODE SNIP //-->

<P>removes all print jobs queued on the printer <TT>hplj</TT> by the user who issues the command or all print jobs for that printer, if issued by <TT>root</TT>.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Warning:&nbsp;&nbsp;</B><BR>It is easy to accidentally remove all print jobs for a printer when you use the <TT>lprm</TT> command as <TT>root</TT>. Take care to use the proper syntax, or you may get frustrated at having to requeue all the jobs!<HR></FONT>

</BLOCKQUOTE>

<P>If a print job ID or a username is supplied as an argument, <TT>lprm</TT> removes that job or all jobs submitted by the user. If no arguments are supplied at all, the currently active job submitted by the user is deleted.</P>

<P>When <TT>lprm</TT> removes files from the queue, it echoes a message to the display. If there are no files to remove, nothing is echoed (and you will be left wondering what, if anything, happened).</P>

<P>If you try to use <TT>lprm</TT> on a job that is currently being printed, it might not be terminated properly because the file might already reside in the printer&#146;s buffer. In some cases, terminating a job that is currently printing can cause the printer to lock because some output format files can&#146;t handle the termination instructions and freeze when the lock file in the spool directory changes. In cases such as this, the <TT>ps</TT> command must be used to find the output filter process ID, and then it must be killed.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Note:&nbsp;&nbsp;</B><BR>In cases of printer lockup that don&#146;t seem to resolve themselves with the <TT>lpc</TT> utility, try killing the <TT>lpd</TT> daemon and restarting it. If that doesn&#146;t work, you will probably have to reboot the entire system.<HR></FONT>

</BLOCKQUOTE>

<H3><A NAME="Heading12"></A><FONT COLOR="#000077">Terminals</FONT></H3>

<P>Most Linux systems use only the system console that came with the PC (the PC&#146;s screen and keyboard act as the system console). You won&#146;t have to make any configuration changes to Linux to use the system console effectively.

</P>

<P>Some system administrators want to add remote terminals to allow other users to work with Linux simultaneously (it <I>is</I> a multiuser system, after all). New terminals can be added to the system in one of two ways: through a serial port on the back of the PC or through a multiport card with many serial ports on it.</P>

<H4 ALIGN="LEFT"><A NAME="Heading13"></A><FONT COLOR="#000077">Using Multiport Cards</FONT></H4>

<P>Multiport cards provide an easy and effective method of adding many serial ports to your system. Multiport cards are offered by dozens of vendors in different configurations. They provide from 2 to 32 additional serial ports per card (for terminals, modems, or printers), and can use several different types of connectors (such as DB25 25-pin connectors, DB9 9-pin connectors, or RJ11 wide telephone-style jacks).

</P>

<P>If you are going to use a multiport card, make sure you can find one with software device drivers that are designed to work with Linux. You can&#146;t use any multiport card designed for other versions of UNIX (or Xenix) without modification. Because multiport card device drivers are complex binaries, modification is beyond the scope of most people&#146;s programming abilities.</P>

<P>Multiport cards come with complete instructions for installing the device drivers for the multiport card, as well as configuring the terminals. Because the details of the configurations change depending on the manufacturer of the multiport card, you should consult the documentation accompanying the card for more information.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

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

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

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

</TR>

</TABLE>

</CENTER>





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

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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