9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man1 / more.1
blob972fcdd353b09b07f7c745d4cc31738844b37c78
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
45 .\" Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH MORE 1 "Nov 4, 2005"
48 .SH NAME
49 more, page \- browse or page through a text file
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fB/usr/bin/more\fR [\fB-cdflrsuw\fR] [\fB-lines\fR] [+ \fIlinenumber\fR]
54      [+/ \fIpattern\fR] [\fIfile\fR]...
55 .fi
57 .LP
58 .nf
59 \fB/usr/bin/page\fR [\fB-cdflrsuw\fR] [\fB-lines\fR] [+ \fIlinenumber\fR]
60      [+/ \fIpattern\fR] [\fIfile\fR]...
61 .fi
63 .LP
64 .nf
65 \fB/usr/xpg4/bin/more\fR [\fB-cdeisu\fR] [\fB-n\fR \fInumber\fR] [\fB-p\fR \fIcommand\fR]
66      [\fB-t\fR \fItagstring\fR] [\fIfile\fR]...
67 .fi
69 .LP
70 .nf
71 \fB/usr/xpg4/bin/more\fR [\fB-cdeisu\fR] [\fB-n\fR \fInumber\fR] [+ \fIcommand\fR]
72      [\fB-t\fR \fItagstring\fR] [\fIfile\fR]...
73 .fi
75 .SH DESCRIPTION
76 .sp
77 .LP
78 The \fBmore\fR utility is a filter that displays the contents of a text file on
79 the terminal, one screenful at a time.  It normally pauses after each
80 screenful. \fB/usr/bin/more\fR then prints \fB--More--\fR and
81 \fB/usr/xpg4/bin/more\fR then prints \fIfile\fR at the bottom of the screen. If
82 \fBmore\fR is reading from a file rather than a pipe, the percentage of
83 characters displayed so far is also shown.
84 .sp
85 .LP
86 The \fBmore\fR utility scrolls up to display one more line in response to a
87 \fBRETURN\fR character. \fBmore\fR displays another screenful in response to a
88 \fBSPACE\fR character. Other commands are listed below.
89 .sp
90 .LP
91 The \fBpage\fR utility clears the screen before displaying the next screenful
92 of text. \fBpage\fR only provides a one-line overlap between screens.
93 .sp
94 .LP
95 The \fBmore\fR utility sets the terminal to \fBNOECHO\fR mode, so that the
96 output can be continuous. Commands that you type do not normally show up on
97 your terminal, except for the \fB/\fR and \fB!\fR commands.
98 .sp
99 .LP
100 The \fB/usr/bin/more\fR utility exits after displaying the last specified file.
101 \fB/usr/xpg4/bin/more\fR prompts for a command at the last line of the last
102 specified file.
105 If the standard output is not a terminal, \fBmore\fR acts just like
106 \fBcat\fR(1), except that a header is printed before each file in a series.
107 .SH OPTIONS
110 The following options are supported for both \fB/usr/bin/more\fR and
111 \fB/usr/xpg4/bin/more\fR:
113 .ne 2
115 \fB\fB-c\fR \fR
117 .RS 7n
118 Clears before displaying. Redraws the screen instead of scrolling for faster
119 displays. This option is ignored if the terminal does not have the ability to
120 clear to the end of a line.
124 .ne 2
126 \fB\fB-d\fR \fR
128 .RS 7n
129 Displays error messages rather than ringing the terminal bell if an
130 unrecognized command is used. This is helpful for inexperienced users.
134 .ne 2
136 \fB\fB-s\fR \fR
138 .RS 7n
139 Squeeze.  Replaces multiple blank lines with a single blank line. This is
140 helpful when viewing \fBnroff\fR(1) output on the screen.
143 .SS "/usr/bin/more"
146 The following options are supported for \fB/usr/bin/more\fR only:
148 .ne 2
150 \fB\fB-f\fR \fR
152 .RS 15n
153 Does not fold long lines. This is useful when lines contain nonprinting
154 characters or escape sequences, such as those generated when \fBnroff\fR(1)
155 output is piped through \fBul\fR(1).
159 .ne 2
161 \fB\fB-l\fR \fR
163 .RS 15n
164 Does not treat \fBFORMFEED\fR characters (Control-l) as page breaks. If
165 \fB-l\fR is not used, \fBmore\fR pauses to accept commands after any line
166 containing a \fB^L\fR character (Control-l). Also, if a file begins with a
167 \fBFORMFEED\fR, the screen is cleared before the file is printed.
171 .ne 2
173 \fB\fB-r\fR \fR
175 .RS 15n
176 Normally, \fBmore\fR ignores control characters that it does not interpret in
177 some way. The \fB-r\fR option causes these to be displayed as \fB^\fR\fIC\fR
178 where \fIC\fR stands for any such control character.
182 .ne 2
184 \fB\fB-u\fR \fR
186 .RS 15n
187 Suppresses generation of underlining escape sequences. Normally, \fBmore\fR
188 handles underlining, such as that produced by \fBnroff\fR(1), in a manner
189 appropriate to the terminal. If the terminal can perform underlining or has a
190 stand-out mode, \fBmore\fR supplies appropriate escape sequences as called for
191 in the text file.
195 .ne 2
197 \fB\fB-w\fR \fR
199 .RS 15n
200 Normally, \fBmore\fR exits when it comes to the end of its input. With
201 \fB-w\fR, however, \fBmore\fR prompts and waits for any key to be struck before
202 exiting.
206 .ne 2
208 \fB\fB-\fR\fIlines\fR\fR
210 .RS 15n
211 Displays the indicated number of \fIlines\fR in each screenful, rather than the
212 default (the number of lines in the terminal screen less two).
216 .ne 2
218 \fB\fB+\fR\fIlinenumber\fR\fR
220 .RS 15n
221 Start up at \fIlinenumber\fR.
225 .ne 2
227 \fB\fB+/\fR\fIpattern\fR\fR
229 .RS 15n
230 Start up two lines above the line containing the regular expression
231 \fIpattern\fR. \fBNote:\fR Unlike editors, this construct should \fInot\fR end
232 with a `\fB/\fR.' If it does, then the trailing slash is taken as a character
233 in the search pattern.
236 .SS "/usr/xpg4/bin/more"
239 The following options are supported for \fB/usr/xpg4/bin/more\fR only:
241 .ne 2
243 \fB\fB-e\fR \fR
245 .RS 17n
246 Exits immediately after writing the last line of the last file in the argument
247 list.
251 .ne 2
253 \fB\fB-i\fR \fR
255 .RS 17n
256 Performs pattern matching in searches without regard to case.
260 .ne 2
262 \fB\fB-n\fR \fInumber\fR \fR
264 .RS 17n
265 Specifies the number of lines per screenful. The \fInumber\fR argument is a
266 positive decimal integer. The \fB-n\fR option overrides any values obtained
267 from the environment.
271 .ne 2
273 \fB\fB-p\fR \fIcommand\fR \fR
277 \fB\fB+\fR\fIcommand\fR \fR
279 .RS 17n
280 For each file examined, initially executes the \fBmore\fR command in the
281 \fIcommand\fR argument. If the command is a positioning command, such as a line
282 number or a regular expression search, set the current position to represent
283 the final results of the command, without writing any intermediate lines of the
284 file. For example, the two commands:
286 .in +2
288 \fBmore -p 1000j file
289 more -p 1000G file\fR
291 .in -2
294 are equivalent and start the display with the current position at line 1000,
295 bypassing the lines that \fBj\fR would write and scroll off the screen if it
296 had been issued during the file examination. If the positioning command is
297 unsuccessful, the first line in the file will be the current position.
301 .ne 2
303 \fB\fB-t\fR \fItagstring\fR \fR
305 .RS 17n
306 Writes the screenful of the file containing the tag named by the
307 \fItagstring\fR argument. See the \fBctags\fR(1) utility.
311 .ne 2
313 \fB\fB-u\fR\fR
315 .RS 17n
316 Treats a backspace character as a printable control character, displayed as a
317 ^H (Control-h), suppressing backspacing and the special handling that produces
318 underlined or standout-mode text on some terminal types.  Also, does not ignore
319 a carriage-return character at the end of a line.
324 If both the \fB-t\fR\fI tagstring\fR and \fB-p\fR\fI command\fR (or the
325 obsolescent \fI+command\fR) options are given, the \fB-t\fR\fI tagstring\fR is
326 processed first.
327 .SH USAGE
328 .SS "Environment"
331 \fBmore\fR uses the terminal's \fBterminfo\fR(4) entry to determine its display
332 characteristics.
335 \fBmore\fR looks in the environment variable \fBMORE\fR for any preset options.
336 For instance, to page through files using the \fB-c\fR mode by default, set the
337 value of this variable to \fB-c\fR. (Normally, the command sequence to set up
338 this environment variable is placed in the \fB\&.login\fR or \fB\&.profile\fR
339 file).
340 .SS "Commands"
343 The commands take effect immediately. It is not necessary to type a carriage
344 return unless the command requires a \fIfile\fR, \fIcommand\fR,
345 \fItagstring\fR, or \fIpattern\fR. Up to the time when the command character
346 itself is given, the user may type the line kill character to cancel the
347 numerical argument being formed. In addition, the user may type the erase
348 character to redisplay the `\fB--More--(\fR\fIxx\fR%)' or \fIfile\fR message.
351 In the following commands, \fIi\fR is a numerical argument (\fB1\fR by
352 default).
354 .ne 2
356 \fB\fIi\fRSPACE \fR
358 .RS 13n
359 Display another screenful, or \fIi\fR more lines if \fIi\fR is specified.
363 .ne 2
365 \fB\fIi\fRRETURN \fR
367 .RS 13n
368 Display another line, or \fIi\fR more lines, if specified.
372 .ne 2
374 \fB\fIi\fR\fBb\fR\fR
378 \fB\fIi\fR\fB^B\fR\fR
380 .RS 13n
381 (Control-b) Skip back \fIi\fR screenfuls and then print a screenful.
385 .ne 2
387 \fB\fIi\fR\fBd\fR\fR
391 \fB\fIi\fR\fB^D\fR\fR
393 .RS 13n
394 (Control-d) Scroll forward one half screenful or \fIi\fR more lines. If \fIi\fR
395 is specified, the count becomes the default for subsequent \fBd\fR and \fBu\fR
396 commands.
400 .ne 2
402 \fB\fIi\fR\fBf\fR\fR
404 .RS 13n
405 Skip \fIi\fR screens full and then print a screenful.
409 .ne 2
411 \fB\fBh\fR\fR
413 .RS 13n
414 Help. Give a description of all the \fBmore\fR commands.
418 .ne 2
420 \fB\fB^L\fR \fR
422 .RS 13n
423 (Control-l) Refresh.
427 .ne 2
429 \fB\fIi\fR\fBn\fR\fR
431 .RS 13n
432 Search for the \fIi\|\fRth occurrence of the last \fIpattern\fR entered.
436 .ne 2
438 \fB\fBq\fR \fR
442 \fB\fBQ\fR \fR
444 .RS 13n
445 Exit from \fBmore\fR.
449 .ne 2
451 \fB\fIi\fR\fBs\fR\fR
453 .RS 13n
454 Skip \fIi\fR lines and then print a screenful.
458 .ne 2
460 \fB\fBv\fR\fR
462 .RS 13n
463 Drop into the \fBvi\fR editor at the current line of the current file.
467 .ne 2
469 \fB\fIi\fR\fBz\fR\fR
471 .RS 13n
472 Same as SPACE, except that \fIi\fR, if present, becomes the new default number
473 of lines per screenful.
477 .ne 2
479 \fB\fB=\fR \fR
481 .RS 13n
482 Display the current line number.
486 .ne 2
488 \fB\fIi\fR\fB/\fR\fIpattern\fR\fR
490 .RS 13n
491 Search forward for the \fIi\|\fRth occurrence of the regular expression
492 \fIpattern\fR. Display the screenful starting two lines before the line that
493 contains the \fIi\|\fRth match for the regular expression \fIpattern\fR, or the
494 end of a pipe, whichever comes first. If \fBmore\fR is displaying a file and
495 there is no match, its position in the file remains unchanged. Regular
496 expressions can be edited using erase and kill characters. Erasing back past
497 the first column cancels the search command.
501 .ne 2
503 \fB\fB!\fR\fIcommand\fR\fR
505 .RS 13n
506 Invoke a shell to execute \fIcommand\|\fR. The characters \fB%\fR and \fB!\fR,
507 when used within \fIcommand\fR are replaced with the current filename and the
508 previous shell command, respectively. If there is no current filename, \fB%\fR
509 is not expanded. Prepend a backslash to these characters to escape expansion.
513 .ne 2
515 \fB\fB:f\fR\fR
517 .RS 13n
518 Display the current filename and line number.
522 .ne 2
524 \fB\fIi\fR\fB:n\fR\fR
526 .RS 13n
527 Skip to the \fIi\|\fRth next filename given in the command line, or to the last
528 filename in the list if \fIi\fR is out of range.
532 .ne 2
534 \fB\fIi\fR\fB:p\fR\fR
536 .RS 13n
537 Skip to the \fIi\|\fRth previous filename given in the command line, or to the
538 first filename if \fIi\fR is out of range. If given while \fBmore\fR is
539 positioned within a file, go to the beginning of the file. If \fBmore\fR is
540 reading from a pipe, \fBmore\fR simply rings the terminal bell.
544 .ne 2
546 \fB\fB:q\fR\fR
550 \fB\fB:Q\fR\fR
552 .RS 13n
553 Exit from \fBmore\fR (same as \fBq\fR or \fBQ\fR).
556 .SS "/usr/bin/more"
559 The following commands are available only in \fB/usr/bin/more\fR:
561 .ne 2
563 \fB\fB\&'\fR\fR
565 .RS 9n
566 Single quote. Go to the point from which the last search started. If no search
567 has been performed in the current file, go to the beginning of the file.
571 .ne 2
573 \fB\fB\&.\fR\fR
575 .RS 9n
576 Dot. Repeat the previous command.
580 .ne 2
582 \fB\fB^\|\e\fR\fR
584 .RS 9n
585 Halt a partial display of text. \fBmore\fR stops sending output, and displays
586 the usual \fB--More--\fR prompt. Some output is lost as a result.
589 .SS "/usr/xpg4/bin/more"
592 The following commands are available only in \fB/usr/xpg4/bin/more\fR:
594 .ne 2
596 \fB\fIi\fR\fB^F\fR\fR
598 .RS 17n
599 (Control-f) Skip \fIi\fR screens full and print a screenful. (Same as
600 \fIi\fR\fBf\fR.)
604 .ne 2
606 \fB\fB^G\fR\fR
608 .RS 17n
609 (Control-g) Display the current line number (same as \fB=\fR).
613 .ne 2
615 \fB\fIi\fR\fBg\fR\fR
617 .RS 17n
618 Go to line number \fIi\fR with the default of the first line in the file.
622 .ne 2
624 \fB\fIi\fR\fBG\fR\fR
626 .RS 17n
627 Go to line number \fIi\fR with the default of the Last line in the file.
631 .ne 2
633 \fB\fIi\fR\fBj\fR\fR
635 .RS 17n
636 Display another line, or \fIi\fR more lines, if specified. (Same as
637 \fIi\fRRETURN.)
641 .ne 2
643 \fB\fIi\fR\fBk\fR\fR
645 .RS 17n
646 Scroll backwards one or \fIi\fR lines, if specified.
650 .ne 2
652 \fB\fBm\fR\fIletter\fR \fR
654 .RS 17n
655 Mark the current position with the name \fIletter\fR.
659 .ne 2
661 \fB\fBN\fR \fR
663 .RS 17n
664 Reverse direction of search.
668 .ne 2
670 \fB\fBr\fR \fR
672 .RS 17n
673 Refresh the screen.
677 .ne 2
679 \fB\fBR\fR \fR
681 .RS 17n
682 Refresh the screen, discarding any buffered input.
686 .ne 2
688 \fB\fIi\fR\fBu\fR\fR
692 \fB\fIi\fR\fB^U\fR\fR
694 .RS 17n
695 (Control-u) Scroll backwards one half a screen of \fIi\fR lines, if specified.
696 If \fIi\fR is specified, the count becomes the new default for subsequent
697 \fBd\fR and \fBu\fR commands.
701 .ne 2
703 \fB\fBZZ\fR \fR
705 .RS 17n
706 Exit from \fBmore\fR (same as \fBq\fR).
710 .ne 2
712 \fB\fB:e\fR \fIfile\fR \fR
714 .RS 17n
715 Examine (display) a new file. If no \fIfile\fR is specified, the current file
716 is redisplayed.
720 .ne 2
722 \fB\fB:t\fR \fItagstring\fR \fR
724 .RS 17n
725 Go to the tag named by the \fItagstring\fR argument and scroll/rewrite the
726 screen with the tagged line in the current position. See the \fBctags\fR
727 utility.
731 .ne 2
733 \fB\fB\&'\fR\fIletter\fR \fR
735 .RS 17n
736 Return to the position that was previously marked with the name \fIletter\fR.
740 .ne 2
742 \fB\fB\&''\fR \fR
744 .RS 17n
745 Return to the position from which the last move of more than a screenful was
746 made. Defaults to the beginning of the file.
750 .ne 2
752 \fB\fIi\fR\fB?\fR[\fI!\fR]\fIpattern\fR\fR
754 .RS 17n
755 Search backward in the file for the \fIi\fRth line containing the
756 \fIpattern\fR. The \fI!\fR specifies to search backward for the \fIi\fRth line
757 that does not contain the \fIpattern\fR.
761 .ne 2
763 \fB\fIi\fR\fB/\fR\fB!\fR\fIpattern\fR\fR
765 .RS 17n
766 Search forward in the file for the \fIi\fRth line that does not contain the
767 pattern.
771 .ne 2
773 \fB\fB!\fR[\fIcommand\fR]\fR
775 .RS 17n
776 Invoke a shell or the specified command.
779 .SS "Large File Behavior"
782 See \fBlargefile\fR(5) for the description of the behavior of \fBmore\fR and
783 \fBpage\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
784 bytes).
785 .SH ENVIRONMENT VARIABLES
788 See \fBenviron\fR(5) for descriptions of the following environment variables
789 that affect the execution of \fBmore\fR: \fBLANG\fR, \fBLC_ALL\fR,
790 \fBLC_COLLATE\fR (\fB/usr/xpg4/bin/more\fR only), \fBLC_CTYPE\fR,
791 \fBLC_MESSAGES\fR, \fBNLSPATH\fR, and \fBTERM\fR.
792 .SS "/usr/xpg4/bin/more"
795 The following environment variables also affect the execution of
796 \fB/usr/xpg4/bin/more\fR:
798 .ne 2
800 \fB\fBCOLUMNS\fR \fR
802 .RS 12n
803 Overrides the system selected horizontal screen size.
807 .ne 2
809 \fB\fBEDITOR\fR \fR
811 .RS 12n
812 Used by the \fBv\fR command to select an editor.
816 .ne 2
818 \fB\fBLINES\fR \fR
820 .RS 12n
821 Overrides the system selected vertical screen size. The \fB-n\fR option has
822 precedence over \fBLINES\fR in determining the number of lines in a screen.
826 .ne 2
828 \fB\fBMORE\fR \fR
830 .RS 12n
831 A string specifying options as described in the OPTIONS section, above. As in a
832 command line, The options must be separated by blank characters and each option
833 specification must start with a \(mi. Any command line options are processed
834 after those specified in \fBMORE\fR as though the command line were: \fBmore
835 $MORE\fR \fIoptions operands\fR
838 .SH EXIT STATUS
841 The following exit values are returned:
843 .ne 2
845 \fB\fB0\fR \fR
847 .RS 7n
848 Successful completion.
852 .ne 2
854 \fB\fB>0\fR \fR
856 .RS 7n
857 An error occurred.
860 .SH FILES
862 .ne 2
864 \fB\fB/usr/lib/more.help\fR\fR
866 .RS 22n
867 help file for \fB/usr/bin/more\fR and  \fB/usr/bin/page\fR only.
870 .SH ATTRIBUTES
873 See \fBattributes\fR(5) for descriptions of the following attributes:
874 .SS "/usr/bin/more /usr/bin/page"
879 box;
880 c | c
881 l | l .
882 ATTRIBUTE TYPE  ATTRIBUTE VALUE
884 CSI     Not enabled
887 .SS "/usr/xpg4/bin/more"
892 box;
893 c | c
894 l | l .
895 ATTRIBUTE TYPE  ATTRIBUTE VALUE
897 CSI     Enabled
899 Interface Stability     Standard
902 .SH SEE ALSO
905 \fBcat\fR(1), \fBcsh\fR(1), \fBctags\fR(1), \fBman\fR(1), \fBnroff\fR(1),
906 \fBscript\fR(1), \fBsh\fR(1), \fBul\fR(1), \fBterminfo\fR(4),
907 \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
908 .SS "/usr/bin/more /usr/bin/page"
911 \fBregcomp\fR(3C)
912 .SS "/usr/xpg4/bin/more"
915 \fBregex\fR(5)
916 .SH NOTES
917 .SS "/usr/bin/more"
920 Skipping backwards is too slow on large files.
921 .SS "/usr/xpg4/bin/more"
924 This utility will not behave correctly if the terminal is not set up properly.