Files
oldlinux-files/study/Ref-docs/POSIX/susv3/utilities/more.html
2024-02-19 00:25:23 -05:00

1048 lines
42 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>more</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="more"></a> <a name="tag_04_89"></a><!-- more -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_04_89_01"></a>NAME</h4>
<blockquote>more - display files on a page-by-page basis</blockquote>
<h4><a name="tag_04_89_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> more</tt> <b>[</b><tt>-ceisu</tt><b>][</b><tt>-n</tt> <i>number</i><b>][</b><tt>-p</tt>
<i>command</i><b>][</b><tt>-t</tt> <i>tagstring</i><b>][</b><i>file</i> <tt>...</tt><b>]</b><tt><img src="../images/opt-end.gif"
alt="[Option End]" border="0"></tt></code></div>
</blockquote>
<h4><a name="tag_04_89_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>more</i> utility shall read files and either write them to the terminal on a page-by-page basis or filter them to
standard output. If standard output is not a terminal device, all input files shall be copied to standard output in their entirety,
without modification, except as specified for the <b>-s</b> option. If standard output is a terminal device, the files shall be
written a number of lines (one screenful) at a time under the control of user commands. See the EXTENDED DESCRIPTION section.</p>
<p>Certain block-mode terminals do not have all the capabilities necessary to support the complete <i>more</i> definition; they are
incapable of accepting commands that are not terminated with a &lt;newline&gt;. Implementations that support such terminals shall
provide an operating mode to <i>more</i> in which all commands can be terminated with a &lt;newline&gt; on those terminals. This
mode:</p>
<ul>
<li>
<p>Shall be documented in the system documentation</p>
</li>
<li>
<p>Shall, at invocation, inform the user of the terminal deficiency that requires the &lt;newline&gt; usage and provide
instructions on how this warning can be suppressed in future invocations</p>
</li>
<li>
<p>Shall not be required for implementations supporting only fully capable terminals</p>
</li>
<li>
<p>Shall not affect commands already requiring &lt;newline&gt;s</p>
</li>
<li>
<p>Shall not affect users on the capable terminals from using <i>more</i> as described in this volume of
IEEE&nbsp;Std&nbsp;1003.1-2001</p>
</li>
</ul>
</blockquote>
<h4><a name="tag_04_89_04"></a>OPTIONS</h4>
<blockquote>
<p>The <i>more</i> utility shall conform to the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>.</p>
<p>The following options shall be supported:</p>
<dl compact>
<dt><b>-c</b></dt>
<dd>If a screen is to be written that has no lines in common with the current screen, or <i>more</i> is writing its first screen,
<i>more</i> shall not scroll the screen, but instead shall redraw each line of the screen in turn, from the top of the screen to
the bottom. In addition, if <i>more</i> is writing its first screen, the screen shall be cleared. This option may be silently
ignored on devices with insufficient terminal capabilities.</dd>
<dt><b>-e</b></dt>
<dd>By default, <i>more</i> shall exit immediately after writing the last line of the last file in the argument list. If the
<b>-e</b> option is specified:
<ol>
<li>
<p>If there is only a single file in the argument list and that file was completely displayed on a single screen, <i>more</i> shall
exit immediately after writing the last line of that file.</p>
</li>
<li>
<p>Otherwise, <i>more</i> shall exit only after reaching end-of-file on the last file in the argument list twice without an
intervening operation. See the EXTENDED DESCRIPTION section.</p>
</li>
</ol>
</dd>
<dt><b>-i</b></dt>
<dd>Perform pattern matching in searches without regard to case; see the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
<a href="../basedefs/xbd_chap09.html#tag_09_02">Section 9.2, Regular Expression General Requirements</a>.</dd>
<dt><b>-n&nbsp;</b> <i>number</i></dt>
<dd>Specify the number of lines per screenful. The <i>number</i> argument is a positive decimal integer. The <b>-n</b> option shall
override any values obtained from any other source.</dd>
<dt><b>-p&nbsp;</b> <i>command</i></dt>
<dd>Each time a screen from a new file is displayed or redisplayed (including as a result of <i>more</i> commands; for example,
<b>:p</b>), execute the <i>more</i> command(s) in the command arguments in the order specified, as if entered by the user after the
first screen has been displayed. No intermediate results shall be displayed (that is, if the command is a movement to a screen
different from the normal first screen, only the screen resulting from the command shall be displayed.) If any of the commands fail
for any reason, an informational message to this effect shall be written, and no further commands specified using the <b>-p</b>
option shall be executed for this file.</dd>
<dt><b>-s</b></dt>
<dd>Behave as if consecutive empty lines were a single empty line.</dd>
<dt><b>-t&nbsp;</b> <i>tagstring</i></dt>
<dd>Write the screenful of the file containing the tag named by the <i>tagstring</i> argument. See the <a href=
"ctags.html"><i>ctags</i></a> utility. The tags feature represented by <b>-t</b> <i>tagstring</i> and the <b>:t</b> command is
optional. It shall be provided on any system that also provides a conforming implementation of <a href=
"../utilities/ctags.html"><i>ctags</i></a>; otherwise, the use of <b>-t</b> produces undefined results.
<p>The filename resulting from the <b>-t</b> option shall be logically added as a prefix to the list of command line files, as if
specified by the user. If the tag named by the <i>tagstring</i> argument is not found, it shall be an error, and <i>more</i> shall
take no further action.</p>
<p>If the tag specifies a line number, the first line of the display shall contain the beginning of that line. If the tag specifies
a pattern, the first line of the display shall contain the beginning of the matching text from the first line of the file that
contains that pattern. If the line does not exist in the file or matching text is not found, an informational message to this
effect shall be displayed, and <i>more</i> shall display the default screen as if <b>-t</b> had not been specified.</p>
<p>If both the <b>-t</b> <i>tagstring</i> and <b>-p</b> <i>command</i> options are given, the <b>-t</b> <i>tagstring</i> shall be
processed first; that is, the file and starting line for the display shall be as specified by <b>-t</b>, and then the <b>-p</b>
<i>more</i> command shall be executed. If the line (matching text) specified by the <b>-t</b> command does not exist (is not
found), no <b>-p</b> <i>more</i> command shall be executed for this file at any time.</p>
</dd>
<dt><b>-u</b></dt>
<dd>Treat a &lt;backspace&gt; as a printable control character, displayed as an implementation-defined character sequence (see the
EXTENDED DESCRIPTION section), suppressing backspacing and the special handling that produces underlined or standout mode text on
some terminal types. Also, do not ignore a &lt;carriage-return&gt; at the end of a line.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_89_05"></a>OPERANDS</h4>
<blockquote>
<p>The following operand shall be supported:</p>
<dl compact>
<dt><i>file</i></dt>
<dd>A pathname of an input file. If no <i>file</i> operands are specified, the standard input shall be used. If a <i>file</i> is
<tt>'-'</tt> , the standard input shall be read at that point in the sequence.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_89_06"></a>STDIN</h4>
<blockquote>
<p>The standard input shall be used only if no <i>file</i> operands are specified, or if a <i>file</i> operand is <tt>'-'</tt>
.</p>
</blockquote>
<h4><a name="tag_04_89_07"></a>INPUT FILES</h4>
<blockquote>
<p>The input files being examined shall be text files. If standard output is a terminal, standard error shall be used to read
commands from the user. If standard output is a terminal, standard error is not readable, and command input is needed, <i>more</i>
may attempt to obtain user commands from the controlling terminal (for example, <b>/dev/tty</b>); otherwise, <i>more</i> shall
terminate with an error indicating that it was unable to read user commands. If standard output is not a terminal, no error shall
result if standard error cannot be opened for reading.</p>
</blockquote>
<h4><a name="tag_04_89_08"></a>ENVIRONMENT VARIABLES</h4>
<blockquote>
<p>The following environment variables shall affect the execution of <i>more</i>:</p>
<dl compact>
<dt><i>COLUMNS</i></dt>
<dd>Override the system-selected horizontal display line size. See the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
<a href="../basedefs/xbd_chap08.html">Chapter 8, Environment Variables</a> for valid values and results when it is unset or
null.</dd>
<dt><i>EDITOR</i></dt>
<dd>Used by the <b>v</b> command to select an editor. See the EXTENDED DESCRIPTION section.</dd>
<dt><i>LANG</i></dt>
<dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> for
the precedence of internationalization variables used to determine the values of locale categories.)</dd>
<dt><i>LC_ALL</i></dt>
<dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
<dt><i>LC_COLLATE</i></dt>
<dd><br>
Determine the locale for the behavior of ranges, equivalence classes, and multi-character collating elements within regular
expressions.</dd>
<dt><i>LC_CTYPE</i></dt>
<dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
opposed to multi-byte characters in arguments and input files) and the behavior of character classes within regular
expressions.</dd>
<dt><i>LC_MESSAGES</i></dt>
<dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and
informative messages written to standard output.</dd>
<dt><i>NLSPATH</i></dt>
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt=
"[Option End]" border="0"></dd>
<dt><i>LINES</i></dt>
<dd>Override the system-selected vertical screen size, used as the number of lines in a screenful. See the Base Definitions volume
of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap08.html">Chapter 8, Environment Variables</a> for valid values and
results when it is unset or null. The <b>-n</b> option shall take precedence over the <i>LINES</i> variable for determining the
number of lines in a screenful.</dd>
<dt><i>MORE</i></dt>
<dd>Determine a string containing options described in the OPTIONS section preceded with hyphens and &lt;blank&gt;-separated as on
the command line. Any command line options shall be processed after those in the <i>MORE</i> variable, as if the command line were:
<pre>
<tt>more $MORE</tt> <i>options operands</i>
</pre>
<p>The <i>MORE</i> variable shall take precedence over the <i>TERM</i> and <i>LINES</i> variables for determining the number of
lines in a screenful.</p>
</dd>
<dt><i>TERM</i></dt>
<dd>Determine the name of the terminal type. If this variable is unset or null, an unspecified default terminal type is used.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_89_09"></a>ASYNCHRONOUS EVENTS</h4>
<blockquote>
<p>Default.</p>
</blockquote>
<h4><a name="tag_04_89_10"></a>STDOUT</h4>
<blockquote>
<p>The standard output shall be used to write the contents of the input files.</p>
</blockquote>
<h4><a name="tag_04_89_11"></a>STDERR</h4>
<blockquote>
<p>The standard error shall be used for diagnostic messages and user commands (see the INPUT FILES section), and, if standard
output is a terminal device, to write a prompting string. The prompting string shall appear on the screen line below the last line
of the file displayed in the current screenful. The prompt shall contain the name of the file currently being examined and shall
contain an end-of-file indication and the name of the next file, if any, when prompting at the end-of-file. If an error or
informational message is displayed, it is unspecified whether it is contained in the prompt. If it is not contained in the prompt,
it shall be displayed and then the user shall be prompted for a continuation character, at which point another message or the user
prompt may be displayed. The prompt is otherwise unspecified. It is unspecified whether informational messages are written for
other user commands.</p>
</blockquote>
<h4><a name="tag_04_89_12"></a>OUTPUT FILES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_04_89_13"></a>EXTENDED DESCRIPTION</h4>
<blockquote>
<p>The following section describes the behavior of <i>more</i> when the standard output is a terminal device. If the standard
output is not a terminal device, no options other than <b>-s</b> shall have any effect, and all input files shall be copied to
standard output otherwise unmodified, at which time <i>more</i> shall exit without further action.</p>
<p>The number of lines available per screen shall be determined by the <b>-n</b> option, if present, or by examining values in the
environment (see the ENVIRONMENT VARIABLES section). If neither method yields a number, an unspecified number of lines shall be
used.</p>
<p>The maximum number of lines written shall be one less than this number, because the screen line after the last line written
shall be used to write a user prompt and user input. If the number of lines in the screen is less than two, the results are
undefined. It is unspecified whether user input is permitted to be longer than the remainder of the single line where the prompt
has been written.</p>
<p>The number of columns available per line shall be determined by examining values in the environment (see the ENVIRONMENT
VARIABLES section), with a default value as described in the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap08.html">Chapter 8, Environment Variables</a>.</p>
<p>Lines that are longer than the display shall be folded; the length at which folding occurs is unspecified, but should be
appropriate for the output device. Folding may occur between glyphs of single characters that take up multiple display columns.</p>
<p>When standard output is a terminal and <b>-u</b> is not specified, <i>more</i> shall treat &lt;backspace&gt;s and
&lt;carriage-return&gt;s specially:</p>
<ul>
<li>
<p>A character, followed first by a sequence of <i>n</i> &lt;backspace&gt;s (where <i>n</i> is the same as the number of column
positions that the character occupies), then by <i>n</i> underscore characters ( <tt>'_'</tt> ), shall cause that character to be
written as underlined text, if the terminal type supports that. The <i>n</i> underscore characters, followed first by <i>n</i>
&lt;backspace&gt;s, then any character with <i>n</i> column positions, shall also cause that character to be written as underlined
text, if the terminal type supports that.</p>
</li>
<li>
<p>A sequence of <i>n</i> &lt;backspace&gt;s (where <i>n</i> is the same as the number of column positions that the previous
character occupies) that appears between two identical printable characters shall cause the first of those two characters to be
written as emboldened text (that is, visually brighter, standout mode, or inverse-video mode), if the terminal type supports that,
and the second to be discarded. Immediately subsequent occurrences of &lt;backspace&gt;/ character pairs for that same character
shall also be discarded. (For example, the sequence <tt>"a\ba\ba\ba"</tt> is interpreted as a single emboldened <tt>'a'</tt> .)</p>
</li>
<li>
<p>The <i>more</i> utility shall logically discard all other &lt;backspace&gt;s from the line as well as the character which
precedes them, if any.</p>
</li>
<li>
<p>A &lt;carriage-return&gt; at the end of a line shall be ignored, rather than being written as a non-printable character, as
described in the next paragraph.</p>
</li>
</ul>
<p>It is implementation-defined how other non-printable characters are written. Implementations should use the same format that
they use for the <a href="../utilities/ex.html"><i>ex</i></a> <b>print</b> command; see the OPTIONS section within the <a href=
"../utilities/ed.html"><i>ed</i></a> utility. It is unspecified whether a multi-column character shall be separated if it crosses a
display line boundary; it shall not be discarded. The behavior is unspecified if the number of columns on the display is less than
the number of columns any single character in the line being displayed would occupy.</p>
<p>When each new file is displayed (or redisplayed), <i>more</i> shall write the first screen of the file. Once the initial screen
has been written, <i>more</i> shall prompt for a user command. If the execution of the user command results in a screen that has
lines in common with the current screen, and the device has sufficient terminal capabilities, <i>more</i> shall scroll the screen;
otherwise, it is unspecified whether the screen is scrolled or redrawn.</p>
<p>For all files but the last (including standard input if no file was specified, and for the last file as well, if the <b>-e</b>
option was not specified), when <i>more</i> has written the last line in the file, <i>more</i> shall prompt for a user command.
This prompt shall contain the name of the next file as well as an indication that <i>more</i> has reached end-of-file. If the user
command is <b>f</b>, &lt;control&gt;-F, &lt;space&gt;, <b>j</b>, &lt;newline&gt;, <b>d</b>, &lt;control&gt;-D, or <b>s</b>,
<i>more</i> shall display the next file. Otherwise, if displaying the last file, <i>more</i> shall exit. Otherwise, <i>more</i>
shall execute the user command specified.</p>
<p>Several of the commands described in this section display a previous screen from the input stream. In the case that text is
being taken from a non-rewindable stream, such as a pipe, it is implementation-defined how much backwards motion is supported. If a
command cannot be executed because of a limitation on backwards motion, an error message to this effect shall be displayed, the
current screen shall not change, and the user shall be prompted for another command.</p>
<p>If a command cannot be performed because there are insufficient lines to display, <i>more</i> shall alert the terminal. If a
command cannot be performed because there are insufficient lines to display or a <b>/</b> command fails: if the input is the
standard input, the last screen in the file may be displayed; otherwise, the current file and screen shall not change, and the user
shall be prompted for another command.</p>
<p>The interactive commands in the following sections shall be supported. Some commands can be preceded by a decimal integer,
called <i>count</i> in the following descriptions. If not specified with the command, <i>count</i> shall default to 1. In the
following descriptions, <i>pattern</i> is a basic regular expression, as described in the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap09.html#tag_09_03">Section 9.3, Basic Regular Expressions</a>. The
term &quot;examine&quot; is historical usage meaning &quot;open the file for viewing''; for example, <i>more</i> <b>foo</b> would be expressed
as examining file <b>foo</b>.</p>
<p>In the following descriptions, unless otherwise specified, <i>line</i> is a line in the <i>more</i> display, not a line from the
file being examined.</p>
<p>In the following descriptions, the <i>current position</i> refers to two things:</p>
<ol>
<li>
<p>The position of the current line on the screen</p>
</li>
<li>
<p>The line number (in the file) of the current line on the screen</p>
</li>
</ol>
<p>Usually, the line on the screen corresponding to the current position is the third line on the screen. If this is not possible
(there are fewer than three lines to display or this is the first page of the file, or it is the last page of the file), then the
current position is either the first or last line on the screen as described later.</p>
<h5><a name="tag_04_89_13_01"></a>Help</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>h
</tt>
</pre>
</dd>
</dl>
<p>Write a summary of these commands and other implementation-defined commands. The behavior shall be as if the <i>more</i> utility
were executed with the <b>-e</b> option on a file that contained the summary information. The user shall be prompted as described
earlier in this section when end-of-file is reached. If the user command is one of those specified to continue to the next file,
<i>more</i> shall return to the file and screen state from which the <b>h</b> command was executed.</p>
<h5><a name="tag_04_89_13_02"></a>Scroll Forward One Screenful</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>f
</tt><b>[</b><i>count</i><b>]</b><tt>&lt;control&gt;-F
</tt>
</pre>
</dd>
</dl>
<p>Scroll forward <i>count</i> lines, with a default of one screenful. If <i>count</i> is more than the screen size, only the final
screenful shall be written.</p>
<h5><a name="tag_04_89_13_03"></a>Scroll Backward One Screenful</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>b
</tt><b>[</b><i>count</i><b>]</b><tt>&lt;control&gt;-B
</tt>
</pre>
</dd>
</dl>
<p>Scroll backward <i>count</i> lines, with a default of one screenful (see the <b>-n</b> option). If <i>count</i> is more than the
screen size, only the final screenful shall be written.</p>
<h5><a name="tag_04_89_13_04"></a>Scroll Forward One Line</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>&lt;space&gt;
</tt><b>[</b><i>count</i><b>]</b><tt>j
</tt><b>[</b><i>count</i><b>]</b><tt>&lt;newline&gt;
</tt>
</pre>
</dd>
</dl>
<p>Scroll forward <i>count</i> lines. The default <i>count</i> for the &lt;space&gt; shall be one screenful; for <b>j</b> and
&lt;newline&gt;, one line. The entire <i>count</i> lines shall be written, even if <i>count</i> is more than the screen size.</p>
<h5><a name="tag_04_89_13_05"></a>Scroll Backward One Line</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>k
</tt>
</pre>
</dd>
</dl>
<p>Scroll backward <i>count</i> lines. The entire <i>count</i> lines shall be written, even if <i>count</i> is more than the screen
size.</p>
<h5><a name="tag_04_89_13_06"></a>Scroll Forward One Half Screenful</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>d
</tt><b>[</b><i>count</i><b>]</b><tt>&lt;control&gt;-D
</tt>
</pre>
</dd>
</dl>
<p>Scroll forward <i>count</i> lines, with a default of one half of the screen size. If <i>count</i> is specified, it shall become
the new default for subsequent <b>d</b>, &lt;control&gt;-D, and <b>u</b> commands.</p>
<h5><a name="tag_04_89_13_07"></a>Skip Forward One Line</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>s
</tt>
</pre>
</dd>
</dl>
<p>Display the screenful beginning with the line <i>count</i> lines after the last line on the current screen. If <i>count</i>
would cause the current position to be such that less than one screenful would be written, the last screenful in the file shall be
written.</p>
<h5><a name="tag_04_89_13_08"></a>Scroll Backward One Half Screenful</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>u
</tt><b>[</b><i>count</i><b>]</b><tt>&lt;control&gt;-U
</tt>
</pre>
</dd>
</dl>
<p>Scroll backward <i>count</i> lines, with a default of one half of the screen size. If <i>count</i> is specified, it shall become
the new default for subsequent <b>d</b>, &lt;control&gt;-D, <b>u</b>, and &lt;control&gt;-U commands. The entire <i>count</i> lines
shall be written, even if <i>count</i> is more than the screen size.</p>
<h5><a name="tag_04_89_13_09"></a>Go to Beginning of File</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>g
</tt>
</pre>
</dd>
</dl>
<p>Display the screenful beginning with line <i>count</i>.</p>
<h5><a name="tag_04_89_13_10"></a>Go to End-of-File</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>G
</tt>
</pre>
</dd>
</dl>
<p>If <i>count</i> is specified, display the screenful beginning with the line <i>count</i>. Otherwise, display the last screenful
of the file.</p>
<h5><a name="tag_04_89_13_11"></a>Refresh the Screen</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>r
&lt;control&gt;-L
</tt>
</pre>
</dd>
</dl>
<p>Refresh the screen.</p>
<h5><a name="tag_04_89_13_12"></a>Discard and Refresh</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>R
</tt>
</pre>
</dd>
</dl>
<p>Refresh the screen, discarding any buffered input. If the current file is non-seekable, buffered input shall not be discarded
and the <b>R</b> command shall be equivalent to the <b>r</b> command.</p>
<h5><a name="tag_04_89_13_13"></a>Mark Position</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>m</tt><i>letter</i>
</pre>
</dd>
</dl>
<p>Mark the current position with the letter named by <i>letter</i>, where <i>letter</i> represents the name of one of the
lowercase letters of the portable character set. When a new file is examined, all marks may be lost.</p>
<h5><a name="tag_04_89_13_14"></a>Return to Mark</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>'</tt><i>letter</i>
</pre>
</dd>
</dl>
<p>Return to the position that was previously marked with the letter named by <i>letter</i>, making that line the current
position.</p>
<h5><a name="tag_04_89_13_15"></a>Return to Previous Position</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>''
</tt>
</pre>
</dd>
</dl>
<p>Return to the position from which the last large movement command was executed (where a &quot;large movement&quot; is defined as any
movement of more than a screenful of lines). If no such movements have been made, return to the beginning of the file.</p>
<h5><a name="tag_04_89_13_16"></a>Search Forward for Pattern</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>/</tt><b>[</b><tt>!</tt><b>]</b><i>pattern</i><tt>&lt;newline&gt;
</tt>
</pre>
</dd>
</dl>
<p>Display the screenful beginning with the <i>count</i>th line containing the pattern. The search shall start after the first line
currently displayed. The null regular expression ( <tt>'/'</tt> followed by a &lt;newline&gt;) shall repeat the search using the
previous regular expression, with a default <i>count</i>. If the character <tt>'!'</tt> is included, the matching lines shall be
those that do not contain the <i>pattern</i>. If no match is found for the <i>pattern</i>, a message to that effect shall be
displayed.</p>
<h5><a name="tag_04_89_13_17"></a>Search Backward for Pattern</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>?</tt><b>[</b><tt>!</tt><b>]</b><i>pattern</i><tt>&lt;newline&gt;
</tt>
</pre>
</dd>
</dl>
<p>Display the screenful beginning with the <i>count</i>th previous line containing the pattern. The search shall start on the last
line before the first line currently displayed. The null regular expression ( <tt>'?'</tt> followed by a &lt;newline&gt;) shall
repeat the search using the previous regular expression, with a default <i>count</i>. If the character <tt>'!'</tt> is included,
matching lines shall be those that do not contain the <i>pattern</i>. If no match is found for the <i>pattern</i>, a message to
that effect shall be displayed.</p>
<h5><a name="tag_04_89_13_18"></a>Repeat Search</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>n
</tt>
</pre>
</dd>
</dl>
<p>Repeat the previous search for <i>count</i>th line containing the last <i>pattern</i> (or not containing the last
<i>pattern</i>, if the previous search was <tt>"/!"</tt> or <tt>"?!"</tt> ).</p>
<h5><a name="tag_04_89_13_19"></a>Repeat Search in Reverse</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>N
</tt>
</pre>
</dd>
</dl>
<p>Repeat the search in the opposite direction of the previous search for the <i>count</i>th line containing the last
<i>pattern</i> (or not containing the last <i>pattern</i>, if the previous search was <tt>"/!"</tt> or <tt>"?!"</tt> ).</p>
<h5><a name="tag_04_89_13_20"></a>Examine New File</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>:e</tt> <b>[</b><i>filename</i><b>]</b><tt>&lt;newline&gt;
</tt>
</pre>
</dd>
</dl>
<p>Examine a new file. If the <i>filename</i> argument is not specified, the current file (see the <b>:n</b> and <b>:p</b> commands
below) shall be re-examined. The <i>filename</i> shall be subjected to the process of shell word expansions (see <a href=
"xcu_chap02.html#tag_02_06"><i>Word Expansions</i></a> ); if more than a single pathname results, the effects are unspecified. If
<i>filename</i> is a number sign ( <tt>'#'</tt> ), the previously examined file shall be re-examined. If <i>filename</i> is not
accessible for any reason (including that it is a non-seekable file), an error message to this effect shall be displayed and the
current file and screen shall not change.</p>
<h5><a name="tag_04_89_13_21"></a>Examine Next File</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>:n
</tt>
</pre>
</dd>
</dl>
<p>Examine the next file. If a number <i>count</i> is specified, the <i>count</i>th next file shall be examined. If <i>filename</i>
refers to a non-seekable file, the results are unspecified.</p>
<h5><a name="tag_04_89_13_22"></a>Examine Previous File</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<b>[</b><i>count</i><b>]</b><tt>:p
</tt>
</pre>
</dd>
</dl>
<p>Examine the previous file. If a number <i>count</i> is specified, the <i>count</i>th previous file shall be examined. If
<i>filename</i> refers to a non-seekable file, the results are unspecified.</p>
<h5><a name="tag_04_89_13_23"></a>Go to Tag</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>:t</tt> <i>tagstring</i><tt>&lt;newline&gt;
</tt>
</pre>
</dd>
</dl>
<p>If the file containing the tag named by the <i>tagstring</i> argument is not the current file, examine the file, as if the
<b>:e</b> command was executed with that file as the argument. Otherwise, or in addition, display the screenful beginning with the
tag, as described for the <b>-t</b> option (see the OPTIONS section). If the <a href="../utilities/ctags.html"><i>ctags</i></a>
utility is not supported by the system, the use of <b>:t</b> produces undefined results.</p>
<h5><a name="tag_04_89_13_24"></a>Invoke Editor</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>v
</tt>
</pre>
</dd>
</dl>
<p>Invoke an editor to edit the current file being examined. If standard input is being examined, the results are unspecified. The
name of the editor shall be taken from the environment variable <i>EDITOR ,</i> or shall default to <a href=
"../utilities/vi.html"><i>vi</i></a>. If the last pathname component in <i>EDITOR</i> is either <a href=
"../utilities/vi.html"><i>vi</i></a> or <a href="../utilities/ex.html"><i>ex</i></a>, the editor shall be invoked with a <b>-c</b>
<i>linenumber</i> command line argument, where <i>linenumber</i> is the line number of the file line containing the display line
currently displayed as the first line of the screen. It is implementation-defined whether line-setting options are passed to
editors other than <a href="../utilities/vi.html"><i>vi</i></a> and <a href="../utilities/ex.html"><i>ex</i></a>.</p>
<p>When the editor exits, <i>more</i> shall resume with the same file and screen as when the editor was invoked.</p>
<h5><a name="tag_04_89_13_25"></a>Display Position</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>=
&lt;control&gt;-G
</tt>
</pre>
</dd>
</dl>
<p>Write a message for which the information references the first byte of the line after the last line of the file on the screen.
This message shall include the name of the file currently being examined, its number relative to the total number of files there
are to examine, the line number in the file, the byte number and the total bytes in the file, and what percentage of the file
precedes the current position. If <i>more</i> is reading from standard input, or the file is shorter than a single screen, the line
number, the byte number, the total bytes, and the percentage need not be written.</p>
<h5><a name="tag_04_89_13_26"></a>Quit</h5>
<dl compact>
<dt><i>Synopsis</i>:</dt>
<dd>
<pre>
<tt>q
:q
ZZ
</tt>
</pre>
</dd>
</dl>
<p>Exit <i>more</i>.</p>
</blockquote>
<h4><a name="tag_04_89_14"></a>EXIT STATUS</h4>
<blockquote>
<p>The following exit values shall be returned:</p>
<dl compact>
<dt>&nbsp;0</dt>
<dd>Successful completion.</dd>
<dt>&gt;0</dt>
<dd>An error occurred.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_89_15"></a>CONSEQUENCES OF ERRORS</h4>
<blockquote>
<p>If an error is encountered accessing a file when using the <b>:n</b> command, <i>more</i> shall attempt to examine the next file
in the argument list, but the final exit status shall be affected. If an error is encountered accessing a file via the <b>:p</b>
command, <i>more</i> shall attempt to examine the previous file in the argument list, but the final exit status shall be affected.
If an error is encountered accessing a file via the <b>:e</b> command, <i>more</i> shall remain in the current file and the final
exit status shall not be affected.</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_04_89_16"></a>APPLICATION USAGE</h4>
<blockquote>
<p>When the standard output is not a terminal, only the <b>-s</b> filter-modification option is effective. This is based on
historical practice. For example, a typical implementation of <a href="../utilities/man.html"><i>man</i></a> pipes its output
through <i>more</i> <b>-s</b> to squeeze excess white space for terminal users. When <a href="../utilities/man.html"><i>man</i></a>
is piped to <a href="../utilities/lp.html"><i>lp</i></a>, however, it is undesirable for this squeezing to happen.</p>
</blockquote>
<h4><a name="tag_04_89_17"></a>EXAMPLES</h4>
<blockquote>
<p>The <b>-p</b> allows arbitrary commands to be executed at the start of each file. Examples are:</p>
<dl compact>
<dt><i>more&nbsp;</i> <b>-p&nbsp;G&nbsp;</b> <i>file1&nbsp;file2</i></dt>
<dd><br>
Examine each file starting with its last screenful.</dd>
<dt><i>more&nbsp;</i> <b>-p&nbsp;</b> 100&nbsp;<i>file1&nbsp;file2</i></dt>
<dd><br>
Examine each file starting with line 100 in the current position (usually the third line, so line 98 would be the first line
written).</dd>
<dt><i>more&nbsp;</i> <b>-p&nbsp;</b> /100&nbsp;<i>file1&nbsp;file2</i></dt>
<dd><br>
Examine each file starting with the first line containing the string <tt>"100"</tt> in the current position</dd>
</dl>
</blockquote>
<h4><a name="tag_04_89_18"></a>RATIONALE</h4>
<blockquote>
<p>The <i>more</i> utility, available in BSD and BSD-derived systems, was chosen as the prototype for the POSIX file display
program since it is more widely available than either the public-domain program <i>less</i> or than <i>pg</i>, a pager provided in
System V. The 4.4 BSD <i>more</i> is the model for the features selected; it is almost fully upwards-compatible from the 4.3 BSD
version in wide use and has become more amenable for <a href="../utilities/vi.html"><i>vi</i></a> users. Several features
originally derived from various file editors, found in both <i>less</i> and <i>pg</i>, have been added to this volume of
IEEE&nbsp;Std&nbsp;1003.1-2001 as they have proved extremely popular with users.</p>
<p>There are inconsistencies between <i>more</i> and <a href="../utilities/vi.html"><i>vi</i></a> that result from historical
practice. For example, the single-character commands <b>h</b>, <b>f</b>, <b>b</b>, and &lt;space&gt; are screen movers in
<i>more</i>, but cursor movers in <a href="../utilities/vi.html"><i>vi</i></a>. These inconsistencies were maintained because the
cursor movements are not applicable to <i>more</i> and the powerful functionality achieved without the use of the control key
justifies the differences.</p>
<p>The tags interface has been included in a program that is not a text editor because it promotes another degree of consistent
operation with <a href="../utilities/vi.html"><i>vi</i></a>. It is conceivable that the paging environment of <i>more</i> would be
superior for browsing source code files in some circumstances.</p>
<p>The operating mode referred to for block-mode terminals effectively adds a &lt;newline&gt; to each Synopsis line that currently
has none. So, for example, <b>d</b> &lt;newline&gt; would page one screenful. The mode could be triggered by a command line option,
environment variable, or some other method. The details are not imposed by this volume of IEEE&nbsp;Std&nbsp;1003.1-2001 because
there are so few systems known to support such terminals. Nevertheless, it was considered that all systems should be able to
support <i>more</i> given the exception cited for this small community of terminals because, in comparison to <a href=
"../utilities/vi.html"><i>vi</i></a>, the cursor movements are few and the command set relatively amenable to the optional
&lt;newline&gt;s.</p>
<p>Some versions of <i>more</i> provide a shell escaping mechanism similar to the <a href="../utilities/ex.html"><i>ex</i></a>
<b>!</b> command. The standard developers did not consider that this was necessary in a paginator, particularly given the wide
acceptance of multiple window terminals and job control features. (They chose to retain such features in the editors and <a href=
"../utilities/mailx.html"><i>mailx</i></a> because the shell interaction also gives an opportunity to modify the editing buffer,
which is not applicable to <i>more</i>.)</p>
<p>The <b>-p</b> (position) option replaces the <b>+</b> command because of the Utility Syntax Guidelines. In early proposals, it
took a <i>pattern</i> argument, but historical <i>less</i> provided the <i>more</i> general facility of a command. It would have
been desirable to use the same <b>-c</b> as <a href="../utilities/ex.html"><i>ex</i></a> and <a href=
"../utilities/vi.html"><i>vi</i></a>, but the letter was already in use.</p>
<p>The text stating &quot;from a non-rewindable stream ... implementations may limit the amount of backwards motion supported&quot; would
allow an implementation that permitted no backwards motion beyond text already on the screen. It was not possible to require a
minimum amount of backwards motion that would be effective for all conceivable device types. The implementation should allow the
user to back up as far as possible, within device and reasonable memory allocation constraints.</p>
<p>Historically, non-printable characters were displayed using the ARPA standard mappings, which are as follows:</p>
<ol>
<li>
<p>Printable characters are left alone.</p>
</li>
<li>
<p>Control characters less than \177 are represented as followed by the character offset from the <tt>'@'</tt> character in the
ASCII map; for example, \007 is represented as <tt>'G'</tt> .</p>
</li>
<li>
<p>\177 is represented as followed by <tt>'?'</tt> .</p>
</li>
</ol>
<p>The display of characters having their eighth bit set was less standard. Existing implementations use hex (0x00), octal (\000),
and a meta-bit display. (The latter displayed characters with their eighth bit set as the two characters <tt>"M-"</tt> , followed
by the seven-bit display as described previously.) The latter probably has the best claim to historical practice because it was
used with the <b>-v</b> option of 4 BSD and 4 BSD-derived versions of the <a href="../utilities/cat.html"><i>cat</i></a> utility
since 1980.</p>
<p>No specific display format is required by IEEE&nbsp;Std&nbsp;1003.1-2001. Implementations are encouraged to conform to historic
practice in the absence of any strong reason to diverge.</p>
</blockquote>
<h4><a name="tag_04_89_19"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_04_89_20"></a>SEE ALSO</h4>
<blockquote>
<p><a href="xcu_chap02.html#tag_02"><i>Shell Command Language</i></a> , <a href="ctags.html"><i>ctags</i></a> , <a href=
"ed.html"><i>ed</i></a> , <a href="ex.html"><i>ex</i></a> , <a href="vi.html"><i>vi</i></a></p>
</blockquote>
<h4><a name="tag_04_89_21"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 4.</p>
</blockquote>
<h4><a name="tag_04_89_22"></a>Issue 5</h4>
<blockquote>
<p>The FUTURE DIRECTIONS section is added.</p>
</blockquote>
<h4><a name="tag_04_89_23"></a>Issue 6</h4>
<blockquote>
<p>This utility is marked as part of the User Portability Utilities option.</p>
<p>The obsolescent SYNOPSIS is removed.</p>
<p>The utility has been extensively reworked for alignment with the IEEE&nbsp;P1003.2b draft standard:</p>
<ul>
<li>
<p>Changes have been made as a result of IEEE PASC Interpretations 1003.2 #37 and #109.</p>
</li>
<li>
<p>The <i>more</i> utility should be able to handle underlined and emboldened displays of characters that are wider than a single
column position.</p>
</li>
</ul>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>