📄 298-303.html
字号:
<HTML>
<HEAD>
<TITLE>Linux in Plain English:Linux Commands Organized by Group</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=1558285423//-->
<!--TITLE=Linux in Plain English//-->
<!--AUTHOR=Patrick Volkerding//-->
<!--AUTHOR=Kevin Reichard//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=5//-->
<!--PAGES=298-303//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="292-297.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="304-309.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>grep......<TT>Search Files</TT></B></FONT></P>
<P><B>grep</B> <I>option(s) pattern file(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>grep</B> command searches a file or multiple files for text strings (referred to as <I>patterns</I> or <I>expressions</I>), and displaying the results of the search on the screen.</P>
<P>The <B>grep</B> command is a relative of the <B>fgrep</B> and <B>egrep</B> commands and is considered the most limited of the lot.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="20%"><B>-A <I>num</I></B>
<TD WIDTH="80%">Displays <I>num</I> of lines after the matched pattern.
<TR>
<TD><B>-b</B>
<TD>Returns the block number of the matched line.
<TR>
<TD><B>-B <I>num</I></B>
<TD>Displays <I>num</I> of lines before the matched pattern.
<TR>
<TD VALIGN="TOP"><B>-c</B>
<TD>Returns the number of matches without listing the actual matches.
<TR>
<TD><B>-C</B>
<TD>Displays two lines before and after the matched pattern.
<TR>
<TD VALIGN="TOP"><B>-e <I>pattern</I></B>
<TD>Searches for <I>pattern</I> when <I>pattern</I> begins with a hyphen (-).
<TR>
<TD><B>-f <I>file</I></B>
<TD>Uses a <I>pattern</I> from <I>file</I>.
<TR>
<TD VALIGN="TOP"><B>-h</B>
<TD>Lists lines with matches without listing the files that contain them.
<TR>
<TD><B>-i</B>
<TD>Ignores case when matching.
<TR>
<TD VALIGN="TOP"><B>-l</B>
<TD>Lists files with matches without listing the actual matches.
<TR>
<TD><B>-L</B>
<TD>Lists files that don’t contain matching lines.
<TR>
<TD><B>-n</B>
<TD>Lists matched lines and their line numbers.
<TR>
<TD><B>-s</B>
<TD>Suppresses error messages.
<TR>
<TD><B>-v</B>
<TD>Lists lines that do not match the pattern.
<TR>
<TD><B>-w</B>
<TD>Lists only whole words that are matched.
<TR>
<TD><B>-x</B>
<TD>Lists only whole lines that are matched.
<TR>
<TD><B>-<I>num</I></B>
<TD>Displays <I>num</I> lines before and after the matched pattern.
</TABLE>
<P><FONT SIZE="+1"><B><I>EXAMPLE</I></B></FONT></P>
<!-- CODE SNIP //-->
<PRE>
$ grep “mail pixmap” *
</PRE>
<!-- END CODE SNIP //-->
<P>This searches the current directory—as noted with <SUB>*</SUB>—for the string <I>mail pixpap</I>.</P>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>egrep</B>
<DD><B>fgrep</B>
</DL>
<P><FONT SIZE="+1"><B>grodvi......<TT>Converts Groff to DVI</TT></B></FONT></P>
<P><B>grodvi</B> <I>option(s) filename(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>grodvi</B> command converts <B>groff</B> output to the TeX DVI format.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="20%"><B>-d</B>
<TD WIDTH="80%">Does not use tpic specials to implement drawing commands.
<TR>
<TD VALIGN="TOP"><B>-F<I>dir</I></B>
<TD>Searches the directory <B><I>dir/devdvi</I></B> for font and device description files.
<TR>
<TD><B>-w<I>n</I></B>
<TD>Sets the default line thickness to <I>n</I> thousandths of an em.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>eqn</B>
<DD><B>groff</B>
<DD><B>tfmtodit</B>
<DD><B>troff</B>
</DL>
<P><FONT SIZE="+1"><B>groff......<TT>Document Formatting</TT></B></FONT></P>
<P><B>groff</B> <I>option(s) filename(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>groff</B> command is a front end to the <B>groff</B> document-formatting commands. It typically runs the <B>troff</B> program and a postprocessor to prepare documents for a specific device.</P>
<P>The postprocessor is specified by the <B>postpro</B> command in the device-description file.</P>
<P><FONT SIZE="+1"><B><I>DEVICES</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>ps</B>
<TD WIDTH="75%">PostScript printers and previewers (default)
<TR>
<TD><B>dvi</B>
<TD>TeX DVI format
<TR>
<TD><B>X75</B>
<TD>X Window 75-dpi previewer
<TR>
<TD><B>X100</B>
<TD>X Window 100-dpi previewer
<TR>
<TD><B>ascii</B>
<TD>Line printers with no formatting
<TR>
<TD><B>latin1</B>
<TD>Line printers with the ISO Latin-1 character set.
</TABLE>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>-e</B>
<TD WIDTH="75%">Preprocesses with <B>eqn</B>.
<TR>
<TD><B>-p</B>
<TD>Preprocesses with <B>pic</B>.
<TR>
<TD><B>-R</B>
<TD>Preprocesses with <B>refer</B>.
<TR>
<TD><B>-s</B>
<TD>Preprocess with <B>soelim</B>.
<TR>
<TD><B>-t</B>
<TD>Preprocesses with <B>tbl</B>.
<TR>
<TD><B>-V</B>
<TD>Prints a pipeline without executing it.
<TR>
<TD><B>-z</B>
<TD>Suppresses output from <B>troff</B>; prints error messages.
<TR>
<TD><B>-Z</B>
<TD>Overrides postprocessing output from <B>troff</B>.
<TR>
<TD><B>-P<I>arg</I></B>
<TD>Passes <I>arg</I> to the postprocessor.
<TR>
<TD><B>-l</B>
<TD>Sends output to a printer.
<TR>
<TD><B>-L<I>arg</I></B>
<TD>Passes <I>arg</I> to the spooler.
<TR>
<TD><B>-T<I>dev</I></B>
<TD>Prepares output for <I>dev</I>. The default is <B>ps</B>.
<TR>
<TD VALIGN="TOP"><B>-X</B>
<TD>Previews with <B>gxditview</B> instead of using the usual postprocessor.
<TR>
<TD><B>-N</B>
<TD>Doesn’t allow newlines with <B>eqn</B> delimiters.
<TR>
<TD><B>-S</B>
<TD>Runs in safer mode.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>eqn</B>
<DD><B>troff</B>
<DD><B>tbl</B>
</DL>
<P><FONT SIZE="+1"><B>grolj4......<TT>Groff for Laserjet 4</TT></B></FONT></P>
<P><B>grolj4</B> <I>option(s) filename(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>grolj4</B> is a <B>groff</B> driver for the H-P Laserjet 4 family, producing output in PCL5 format.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>-c<I>n</I></B>
<TD WIDTH="75%">Prints <I>n</I> copies of each page.
<TR>
<TD VALIGN="TOP"><B>-F<I>dir</I></B>
<TD>Searches directory <B><I>dir/devlj4</I></B> for font and device-description files.
<TR>
<TD><B>-l</B>
<TD>Prints the document with a landscape orientation.
<TR>
<TD VALIGN="TOP"><B>-p <I>size</I></B>
<TD>Sets the paper size to <I>size</I>: letter, legal, executive, a4, com10, monarch, c5, b5, or dl.
<TR>
<TD><B>-w<I>n</I></B>
<TD>Sets the default line thickness to <I>n</I> thousandths of an em.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>eqn</B>
<DD><B>groff</B>
<DD><B>tfmtodit</B>
<DD><B>troff</B>
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="292-297.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="304-309.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 + -