📄 309-312.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=309-312//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="304-309.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="312-316.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>join......<TT>Join Files</TT></B></FONT></P>
<IMG SRC="images/05-114i.jpg"><P><B>join</B> <I>option(s) file1 file2</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>join</B> command joins lines of two files (<I>file1</I>and <I>file2</I>) on a common join field.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%"><B>-1 <I>field</I></B>
<TD WIDTH="75%">Joins on field <I>field</I> of <I>file1</I>.
<TR>
<TD><B>-2 <I>field</I></B>
<TD>Joins on field <I>field</I> of <I>file2</I>.
<TR>
<TD><B>-a <I>file-number</I></B>
<TD>Prints a line listing each unpairable line in <I>file1</I> or <I>file2</I>.
<TR>
<TD><B>-e <I>string</I></B>
<TD>Replaces empty output fields with <I>string</I>.
<TR>
<TD VALIGN="TOP"><B>-o <I>field-list</I></B>
<TD>Uses the format in <I>field-list</I> to construct the output lines.
<TR>
<TD><B>-t <I>char</I></B>
<TD>Inserts <I>char</I> as the input and output field separator.
<TR>
<TD VALIGN="TOP"><B>-v <I>file</I></B>
<TD>Prints a line for each unpairable line in <I>file</I> (either <I>file1</I> or <I>file2</I>), instead of the normal output.
</TABLE>
<P><FONT SIZE="+1"><B>less......<TT>View Files</TT></B></FONT></P>
<IMG SRC="images/05-115i.jpg"><P><B>less</B> <I>option(s) file(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>less</B> command displays portions of a file interactively. It’s designed as a more advanced version of the old UNIX <B>more</B> command—it allows you to move backward in the file as well as forward—and it reads in portions of files, not entire files, so it’s quicker than text editors.</P>
<P>You may find that the <B>less</B> command is one of your most frequently used commands, since it’s so flexible and provides the best aspects of the <B>cat</B> command and your text editors.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%" VALIGN="TOP"><B>-?</B>
<TD WIDTH="75%">Displays available commands, along with a summary of their functionality.
<TR>
<TD VALIGN="TOP"><B>-h</B>
<TD>Displays available commands, along with a summary of their functionality.
<TR>
<TD VALIGN="TOP"><B>-a</B>
<TD>Creates a new display after the last line displayed. (The default is two lines.)
<TR>
<TD VALIGN="TOP"><B>-b<I>buffers</I></B>
<TD>Displays by <I>buffers</I> bytes of size. A buffer is 1 kilobyte, and 10 buffers are used for each file.
<TR>
<TD VALIGN="TOP"><B>-B</B>
<TD>Allocates buffers automatically as needed if data is read through a pipe.
<TR>
<TD><B>-c</B>
<TD>Redraws the screen from the top, not the bottom.
<TR>
<TD VALIGN="TOP"><B>-C</B>
<TD>Redraws the screen from the top, not the bottom, and clears the screen before repainting.
<TR>
<TD VALIGN="TOP"><B>-d</B>
<TD>Suppresses error messages displayed on dumb terminals, such as noting that the terminal lacks the ability to clear the screen.
<TR>
<TD><B>-e</B>
<TD>Exits <B>less</B> the second time it reaches the end of the file.
<TR>
<TD><B>-E</B>
<TD>Exits <B>less</B> the first time it reaches the end of the file.
<TR>
<TD VALIGN="TOP"><B>-f</B>
<TD>Forces <B>less</B> to open nonregular files, such as directories or device drivers, and also suppresses error messages when binary files are opened.
<TR>
<TD VALIGN="TOP"><B>-g</B>
<TD>Highlights strings matching only the last search command, not all search commands.
<TR>
<TD><B>-G</B>
<TD>Suppresses highlighting of strings.
<TR>
<TD VALIGN="TOP"><B>-h<I>num</I></B>
<TD>Specifies the maximum <I>num</I> of lines to scroll backward.
<TR>
<TD VALIGN="TOP"><B>-i</B>
<TD>Disregards case when searching. If an uppercase letter is included in a search pattern, then case is taken into account.
<TR>
<TD VALIGN="TOP"><B>-I</B>
<TD>Disregards case when searching, even if an uppercase letter is included in a search pattern.
<TR>
<TD VALIGN="TOP"><B>-j<I>num</I></B>
<TD>Specifies a “target” line to be positioned at the top of the screen. This can be the object of a text search, tag search, line number, a file percentage, or marked position. A negative number would position the “target” line relative to the bottom of the screen.
<TR>
<TD><B>-k<I>filename</I></B>
<TD>Opens a file as a <B>lesskey</B> file, not as a normal text file.
<TR>
<TD VALIGN="TOP"><B>-m</B>
<TD>Opens in verbose mode a la the <B>more</B> command, with percentages listed at the bottom of the screen.
<TR>
<TD VALIGN="TOP"><B>-M</B>
<TD>Opens in verbose mode a la the <B>more</B> command, with percentages, line numbers, and total lines listed at the bottom of the screen.
<TR>
<TD><B>-n</B>
<TD>Turns off listing line numbers.
<TR>
<TD VALIGN="TOP"><B>-N</B>
<TD>Lists line numbers at the beginning of each line in the display.
<TR>
<TD VALIGN="TOP"><B>-o<I>filename</I></B>
<TD>Copies output to <I>filename</I> from a pipe. If <I>filename</I> exists, <B>less</B> asks for permission before overwriting it.
<TR>
<TD VALIGN="TOP"><B>-O<I>filename</I></B>
<TD>Copies output to <I>filename</I> from a pipe. If <I>filename</I> exists, <B>less</B> will not ask for permission before overwriting it.
<TR>
<TD><B>-p<I>pattern</I></B>
<TD>Starts <B>less</B> at the first occurrence of <I>pattern</I>.
<TR>
<TD VALIGN="TOP"><B>-P<I>prompt</I></B>
<TD>Defines prompt in one of three ways:
</TABLE>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%">
<TD WIDTH="25%"><B>-P<I>string</I></B>
<TD WIDTH="50%">Prompt is <B><I>string</I></B>.
<TR>
<TD>
<TD><B>-P<I>mstring</I></B>
<TD>Medium prompt is <B><I>string</I></B>.
<TR>
<TD>
<TD><B>-P<I>mstring</I></B>
<TD>Long prompt is <B><I>string</I></B>.
<TR>
<TD VALIGN="TOP"><B>-q</B>
<TD>Works in quiet mode, where no sounds are made if there is an attempt to scroll past the end of the file or before the beginning of the file.
<TR>
<TD><B>-Q</B>
<TD>Works in totally quiet mode, where no system sounds are made.
<TR>
<TD VALIGN="TOP"><B>-r</B>
<TD>Displays “raw” characters, instead of using carets. Can cause display errors.
<TR>
<TD VALIGN="TOP"><B>-s</B>
<TD>Squeezes consecutive blank lines into a single blank line. Usually used with <B>nroff</B> files.
<TR>
<TD VALIGN="TOP"><B>-S</B>
<TD>Chops off lines longer than the screen, discarding them instead of folding them into the next line.
<TR>
<TD VALIGN="TOP"><B>-t<I>tag</I></B>
<TD>Edits a file containing <I>tag</I>, contained in <B>./tags</B> and generated by the <B>ctags</B> command.
<TR>
<TD VALIGN="TOP"><B>-T<I>tagfile</I></B>
<TD>Specifies a tags file to be used instead of ./tags.
<TR>
<TD VALIGN="TOP"><B>-u</B>
<TD>Treats backspaces and carriage returns as printable characters.
<TR>
<TD><B>-U</B>
<TD>Treats backspaces and carriage returns as control characters.
<TR>
<TD><B>-V</B>
<TD>Displays the version number of <B>less</B>.
<TR>
<TD VALIGN="TOP"><B>-w</B>
<TD>Represents lines after the end of the file as blank lines instead of tilde (~) characters.
<TR>
<TD><B>-x<I>num</I></B>
<TD>Sets the tab every <I>num</I> positions; the default is eight.
<TR>
<TD VALIGN="TOP"><B>-X</B>
<TD>Disables sending the termcap initialization and deinitialization strings to the terminal.
<TR>
<TD><B>-y<I>num</I></B>
<TD>Specifies a maximum number of lines to scroll forward.
<TR>
<TD VALIGN="TOP"><B>-[z]<I>num</I></B>
<TD>Changes the default scrolling window size to <I>num</I> lines; the default is one screen.
</TABLE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="304-309.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="312-316.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 + -