📄 341-351.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=341-351//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="336-340.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="352-361.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>tac......<TT>Reverse Cat</TT></B></FONT></P>
<IMG SRC="images/05-123i.jpg"><P><B>tac</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>tac</B> command (opposite of <B>cat</B>) is used to display files in reverse order; that is, the ending line of a file is displayed first, followed by the second-to-the-last line, and so on.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%" VALIGN="TOP"><B>-b</B>
<TD WIDTH="75%">Attaches the separator to the beginning of the record that precedes it.
<TR>
<TD><B>-r</B>
<TD>Sets the separator to a regular expression.
<TR>
<TD><B>-s <I>string</I></B>
<TD>Sets <I>string</I> as the record separator.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMAND</I></B></FONT></P>
<DL>
<DD>cat</B>
</DL>
<P><FONT SIZE="+1"><B>tail......<TT>Print End of File</TT></B></FONT></P>
<IMG SRC="images/05-124i.jpg"><P><B>tail</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>tail</B> command prints the last 10 lines of <I>filename</I> to the screen. You can display more or less of the file using options. The command is the opposite of the <B>head</B> command, used to display the first 10 lines of a file.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>-c <I>num</I></B>
<TD WIDTH="75%">Displays <I>num</I> number of bytes.
<TR>
<TD VALIGN="TOP"><B>-f</B>
<TD>Loops forever trying to read more characters at the end of the file, on the assumption that the file is growing.
<TR>
<TD><B>-l <I>num</I></B>
<TD>Displays <I>num</I> number of lines.
<TR>
<TD><B>-q</B>
<TD>Does not print filename headers.
<TR>
<TD><B>-v</B>
<TD>Prints filename headers.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMAND</I></B></FONT></P>
<DL>
<DD><B>head</B>
</DL>
<P><FONT SIZE="+1"><B>tr......<TT>Translate Characters</TT></B></FONT></P>
<IMG SRC="images/05-125i.jpg"><P><B>tr</B> <I>option(s) [string1 [string2]]</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>tr</B> command translates or deletes characters, replacing <I>string1</I> with <I>string2</I>.</P>
<P><FONT SIZE="+1"><B>troff......<TT>Format Documents</TT></B></FONT></P>
<IMG SRC="images/05-126i.jpg"><P><B>troff</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>troff</B> command is a text formatter, part of the <B>groff</B> family of formatters. You usually don’t use it on your own. Rather, it is invoked by the <B>groff</B> command on its own. Check the <B>groff</B> command for more information.</P>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>groff</B>
</DL>
<P><FONT SIZE="+1"><B>Unexpand......<TT>Unexpand File</TT></B></FONT></P>
<IMG SRC="images/05-127i.jpg"><P><B>unexpand</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>unexpand</B> command converts spaces to tabs in a textfile.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%" VALIGN="TOP"><B>-a</B>
<TD WIDTH="75%">Converts all strings of two or more spaces or tabs, not just initial ones, to tabs.
<TR>
<TD><B>-t <I>tab1</I></B>
<TD>Set the tabs <I>tab1</I> spaces apart, instead of the default 8.
</TABLE>
<P><FONT SIZE="+1"><B>uniq......<TT>Create Unique Files</TT></B></FONT></P>
<IMG SRC="images/05-128i.jpg"><P><B>uniq</B> <I>option(s) filename1 filename2</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>uniq</B> command strips duplicate lines from a specified file (<I>filename1</I>) and then sends them either to another file (<I>filename2</I>) or to standard output is no other file is named.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>-c</B>
<TD WIDTH="75%">Counts duplicate lines.
<TR>
<TD><B>-d</B>
<TD>Returns duplicate lines, but no unique lines.
<TR>
<TD VALIGN="TOP"><B>-f<I>n</I></B>
<TD>Skips the first <I>n</I> fields of a line; fields are separated by spaces or tabs.
<TR>
<TD VALIGN="TOP"><B>-s<I>n</I></B>
<TD>Skips the first <I>n</I> characters of a field; fields are separated by spaces or tabs.
<TR>
<TD VALIGN="TOP"><B>-u</B>
<TD>Returns unique lines, and duplicate lines are sent to the ether.
<TR>
<TD><B>-w <I>n</I></B>
<TD>Compares the first <I>n</I> characters of a line.
<TR>
<TD VALIGN="TOP"><B>-<I>n</I></B>
<TD>Skips the first <I>n</I> fields of a line; fields are separated by spaces or tabs.
<TR>
<TD VALIGN="TOP"><B>+<I>n</I></B>
<TD>Skips the first <I>n</I> characters of a field; fields are separated by spaces or tabs.
<TR>
<TD><B>--check-chars=<I>n</I></B>
<TD>Compares the first <I>n</I> characters of a line.
<TR>
<TD VALIGN="TOP"><B>--skip-chars=<I>n</I></B>
<TD>Skips the first <I>n</I> characters of a field; fields are separated by spaces or tabs.
<TR>
<TD VALIGN="TOP"><B>--skip-fields=<I>n</I></B>
<TD>Skips the first <I>n</I> fields of a line; fields are separated by spaces or tabs.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>comm</B>
<DD><B>sort</B>
</DL>
<P><FONT SIZE="+1"><B>vi......<TT>Text Editor</TT></B></FONT></P>
<P><B>vi</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>vi</B> command is actually a shortcut to the <B>elvis</B> text editor. (Technically, the <B>vi</B> editor found on other UNIX systems is not the same <B>vi</B> as this one.) See <B>elvis</B> for more information.</P>
<P><FONT SIZE="+1"><B>vim......<TT>Vi Improved</TT></B></FONT></P>
<P><B>vim</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>vim</B> text editor is an <B>vi-</B>compatible text editor useful for editing text files. See the online-manual pages for a list of the available options.</P>
<P><FONT SIZE="+1"><B>wc......<TT>Word Count</TT></B></FONT></P>
<P><B>wc</B> <I>option(s) filename</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>wc</B> command counts the words in a text file; if no <I>filename</I> is specified, then standard input is counted. This is a handy command when combined with other text-processing commands within a pipeline.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>-bytes</B>
<TD WIDTH="75%">Prints the character count.
<TR>
<TD><B>-c</B>
<TD>Prints the character count.
<TR>
<TD><B>--chars</B>
<TD>Prints the character count.
<TR>
<TD><B>-l</B>
<TD>Prints the number of lines in the file.
<TR>
<TD><B>--lines</B>
<TD>Prints the number of lines in the file.
<TR>
<TD VALIGN="TOP"><B>-w</B>
<TD>Prints the number of words in the file; this is the default.
<TR>
<TD VALIGN="TOP"><B>--words</B>
<TD>Prints the number of words in the file; this is the default.
</TABLE>
<P><FONT SIZE="+1"><B><I>EXAMPLE</I></B></FONT></P>
<!-- CODE SNIP //-->
<PRE>
$ wc textfile
324
</PRE>
<!-- END CODE SNIP //-->
<P><FONT SIZE="+1"><B>xedit......<TT>X Editor</TT></B></FONT></P>
<IMG SRC="images/05-129i.jpg"><P><B>xedit</B> <I>filename(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>xedit</B> command launches a simple text editor running under the X Window System.</P>
<P><FONT SIZE="+1"><B>zcmp......<TT>Compare Compressed Files</TT></B></FONT></P>
<P><B>zcmp</B> <I>option(s) file(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>zcmp</B> command uncompresses a <B>gzip</B> compressed file and calls on <B>cmp</B>. The options associated with this command are actually <B>cmp</B> options, which are passed along to <B>cmp</B> along with the compressed file.</P>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>cmp</B>
<DD><B>gzip</B>
<DD><B>zegrep</B>
<DD><B>zfgrep</B>
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="336-340.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="352-361.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 + -