6001 strcat(9f) needs a manpage
[unleashed.git] / usr / src / man / man1 / more.1
blob25522161b948a0ff7b4d6bbc17d08289758c60a8
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved  Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH MORE 1 "Nov 4, 2005"
11 .SH NAME
12 more, page \- browse or page through a text file
13 .SH SYNOPSIS
14 .LP
15 .nf
16 \fB/usr/bin/more\fR [\fB-cdflrsuw\fR] [\fB-lines\fR] [+ \fIlinenumber\fR]
17      [+/ \fIpattern\fR] [\fIfile\fR]...
18 .fi
20 .LP
21 .nf
22 \fB/usr/bin/page\fR [\fB-cdflrsuw\fR] [\fB-lines\fR] [+ \fIlinenumber\fR]
23      [+/ \fIpattern\fR] [\fIfile\fR]...
24 .fi
26 .LP
27 .nf
28 \fB/usr/xpg4/bin/more\fR [\fB-cdeisu\fR] [\fB-n\fR \fInumber\fR] [\fB-p\fR \fIcommand\fR]
29      [\fB-t\fR \fItagstring\fR] [\fIfile\fR]...
30 .fi
32 .LP
33 .nf
34 \fB/usr/xpg4/bin/more\fR [\fB-cdeisu\fR] [\fB-n\fR \fInumber\fR] [+ \fIcommand\fR]
35      [\fB-t\fR \fItagstring\fR] [\fIfile\fR]...
36 .fi
38 .SH DESCRIPTION
39 .sp
40 .LP
41 The \fBmore\fR utility is a filter that displays the contents of a text file on
42 the terminal, one screenful at a time.  It normally pauses after each
43 screenful. \fB/usr/bin/more\fR then prints \fB--More--\fR and
44 \fB/usr/xpg4/bin/more\fR then prints \fIfile\fR at the bottom of the screen. If
45 \fBmore\fR is reading from a file rather than a pipe, the percentage of
46 characters displayed so far is also shown.
47 .sp
48 .LP
49 The \fBmore\fR utility scrolls up to display one more line in response to a
50 \fBRETURN\fR character. \fBmore\fR displays another screenful in response to a
51 \fBSPACE\fR character. Other commands are listed below.
52 .sp
53 .LP
54 The \fBpage\fR utility clears the screen before displaying the next screenful
55 of text. \fBpage\fR only provides a one-line overlap between screens.
56 .sp
57 .LP
58 The \fBmore\fR utility sets the terminal to \fBNOECHO\fR mode, so that the
59 output can be continuous. Commands that you type do not normally show up on
60 your terminal, except for the \fB/\fR and \fB!\fR commands.
61 .sp
62 .LP
63 The \fB/usr/bin/more\fR utility exits after displaying the last specified file.
64 \fB/usr/xpg4/bin/more\fR prompts for a command at the last line of the last
65 specified file.
66 .sp
67 .LP
68 If the standard output is not a terminal, \fBmore\fR acts just like
69 \fBcat\fR(1), except that a header is printed before each file in a series.
70 .SH OPTIONS
71 .sp
72 .LP
73 The following options are supported for both \fB/usr/bin/more\fR and
74 \fB/usr/xpg4/bin/more\fR:
75 .sp
76 .ne 2
77 .na
78 \fB\fB-c\fR \fR
79 .ad
80 .RS 7n
81 Clears before displaying. Redraws the screen instead of scrolling for faster
82 displays. This option is ignored if the terminal does not have the ability to
83 clear to the end of a line.
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fB\fB-d\fR \fR
90 .ad
91 .RS 7n
92 Displays error messages rather than ringing the terminal bell if an
93 unrecognized command is used. This is helpful for inexperienced users.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fB-s\fR \fR
101 .RS 7n
102 Squeeze.  Replaces multiple blank lines with a single blank line. This is
103 helpful when viewing \fBnroff\fR(1) output on the screen.
106 .SS "/usr/bin/more"
109 The following options are supported for \fB/usr/bin/more\fR only:
111 .ne 2
113 \fB\fB-f\fR \fR
115 .RS 15n
116 Does not fold long lines. This is useful when lines contain nonprinting
117 characters or escape sequences, such as those generated when \fBnroff\fR(1)
118 output is piped through \fBul\fR(1).
122 .ne 2
124 \fB\fB-l\fR \fR
126 .RS 15n
127 Does not treat \fBFORMFEED\fR characters (Control-l) as page breaks. If
128 \fB-l\fR is not used, \fBmore\fR pauses to accept commands after any line
129 containing a \fB^L\fR character (Control-l). Also, if a file begins with a
130 \fBFORMFEED\fR, the screen is cleared before the file is printed.
134 .ne 2
136 \fB\fB-r\fR \fR
138 .RS 15n
139 Normally, \fBmore\fR ignores control characters that it does not interpret in
140 some way. The \fB-r\fR option causes these to be displayed as \fB^\fR\fIC\fR
141 where \fIC\fR stands for any such control character.
145 .ne 2
147 \fB\fB-u\fR \fR
149 .RS 15n
150 Suppresses generation of underlining escape sequences. Normally, \fBmore\fR
151 handles underlining, such as that produced by \fBnroff\fR(1), in a manner
152 appropriate to the terminal. If the terminal can perform underlining or has a
153 stand-out mode, \fBmore\fR supplies appropriate escape sequences as called for
154 in the text file.
158 .ne 2
160 \fB\fB-w\fR \fR
162 .RS 15n
163 Normally, \fBmore\fR exits when it comes to the end of its input. With
164 \fB-w\fR, however, \fBmore\fR prompts and waits for any key to be struck before
165 exiting.
169 .ne 2
171 \fB\fB-\fR\fIlines\fR\fR
173 .RS 15n
174 Displays the indicated number of \fIlines\fR in each screenful, rather than the
175 default (the number of lines in the terminal screen less two).
179 .ne 2
181 \fB\fB+\fR\fIlinenumber\fR\fR
183 .RS 15n
184 Start up at \fIlinenumber\fR.
188 .ne 2
190 \fB\fB+/\fR\fIpattern\fR\fR
192 .RS 15n
193 Start up two lines above the line containing the regular expression
194 \fIpattern\fR. \fBNote:\fR Unlike editors, this construct should \fInot\fR end
195 with a `\fB/\fR.' If it does, then the trailing slash is taken as a character
196 in the search pattern.
199 .SS "/usr/xpg4/bin/more"
202 The following options are supported for \fB/usr/xpg4/bin/more\fR only:
204 .ne 2
206 \fB\fB-e\fR \fR
208 .RS 17n
209 Exits immediately after writing the last line of the last file in the argument
210 list.
214 .ne 2
216 \fB\fB-i\fR \fR
218 .RS 17n
219 Performs pattern matching in searches without regard to case.
223 .ne 2
225 \fB\fB-n\fR \fInumber\fR \fR
227 .RS 17n
228 Specifies the number of lines per screenful. The \fInumber\fR argument is a
229 positive decimal integer. The \fB-n\fR option overrides any values obtained
230 from the environment.
234 .ne 2
236 \fB\fB-p\fR \fIcommand\fR \fR
240 \fB\fB+\fR\fIcommand\fR \fR
242 .RS 17n
243 For each file examined, initially executes the \fBmore\fR command in the
244 \fIcommand\fR argument. If the command is a positioning command, such as a line
245 number or a regular expression search, set the current position to represent
246 the final results of the command, without writing any intermediate lines of the
247 file. For example, the two commands:
249 .in +2
251 \fBmore -p 1000j file
252 more -p 1000G file\fR
254 .in -2
257 are equivalent and start the display with the current position at line 1000,
258 bypassing the lines that \fBj\fR would write and scroll off the screen if it
259 had been issued during the file examination. If the positioning command is
260 unsuccessful, the first line in the file will be the current position.
264 .ne 2
266 \fB\fB-t\fR \fItagstring\fR \fR
268 .RS 17n
269 Writes the screenful of the file containing the tag named by the
270 \fItagstring\fR argument. See the \fBctags\fR(1) utility.
274 .ne 2
276 \fB\fB-u\fR\fR
278 .RS 17n
279 Treats a backspace character as a printable control character, displayed as a
280 ^H (Control-h), suppressing backspacing and the special handling that produces
281 underlined or standout-mode text on some terminal types.  Also, does not ignore
282 a carriage-return character at the end of a line.
287 If both the \fB-t\fR\fI tagstring\fR and \fB-p\fR\fI command\fR (or the
288 obsolescent \fI+command\fR) options are given, the \fB-t\fR\fI tagstring\fR is
289 processed first.
290 .SH USAGE
291 .SS "Environment"
294 \fBmore\fR uses the terminal's \fBterminfo\fR(4) entry to determine its display
295 characteristics.
298 \fBmore\fR looks in the environment variable \fBMORE\fR for any preset options.
299 For instance, to page through files using the \fB-c\fR mode by default, set the
300 value of this variable to \fB-c\fR. (Normally, the command sequence to set up
301 this environment variable is placed in the \fB\&.login\fR or \fB\&.profile\fR
302 file).
303 .SS "Commands"
306 The commands take effect immediately. It is not necessary to type a carriage
307 return unless the command requires a \fIfile\fR, \fIcommand\fR,
308 \fItagstring\fR, or \fIpattern\fR. Up to the time when the command character
309 itself is given, the user may type the line kill character to cancel the
310 numerical argument being formed. In addition, the user may type the erase
311 character to redisplay the `\fB--More--(\fR\fIxx\fR%)' or \fIfile\fR message.
314 In the following commands, \fIi\fR is a numerical argument (\fB1\fR by
315 default).
317 .ne 2
319 \fB\fIi\fRSPACE \fR
321 .RS 13n
322 Display another screenful, or \fIi\fR more lines if \fIi\fR is specified.
326 .ne 2
328 \fB\fIi\fRRETURN \fR
330 .RS 13n
331 Display another line, or \fIi\fR more lines, if specified.
335 .ne 2
337 \fB\fIi\fR\fBb\fR\fR
341 \fB\fIi\fR\fB^B\fR\fR
343 .RS 13n
344 (Control-b) Skip back \fIi\fR screenfuls and then print a screenful.
348 .ne 2
350 \fB\fIi\fR\fBd\fR\fR
354 \fB\fIi\fR\fB^D\fR\fR
356 .RS 13n
357 (Control-d) Scroll forward one half screenful or \fIi\fR more lines. If \fIi\fR
358 is specified, the count becomes the default for subsequent \fBd\fR and \fBu\fR
359 commands.
363 .ne 2
365 \fB\fIi\fR\fBf\fR\fR
367 .RS 13n
368 Skip \fIi\fR screens full and then print a screenful.
372 .ne 2
374 \fB\fBh\fR\fR
376 .RS 13n
377 Help. Give a description of all the \fBmore\fR commands.
381 .ne 2
383 \fB\fB^L\fR \fR
385 .RS 13n
386 (Control-l) Refresh.
390 .ne 2
392 \fB\fIi\fR\fBn\fR\fR
394 .RS 13n
395 Search for the \fIi\|\fRth occurrence of the last \fIpattern\fR entered.
399 .ne 2
401 \fB\fBq\fR \fR
405 \fB\fBQ\fR \fR
407 .RS 13n
408 Exit from \fBmore\fR.
412 .ne 2
414 \fB\fIi\fR\fBs\fR\fR
416 .RS 13n
417 Skip \fIi\fR lines and then print a screenful.
421 .ne 2
423 \fB\fBv\fR\fR
425 .RS 13n
426 Drop into the \fBvi\fR editor at the current line of the current file.
430 .ne 2
432 \fB\fIi\fR\fBz\fR\fR
434 .RS 13n
435 Same as SPACE, except that \fIi\fR, if present, becomes the new default number
436 of lines per screenful.
440 .ne 2
442 \fB\fB=\fR \fR
444 .RS 13n
445 Display the current line number.
449 .ne 2
451 \fB\fIi\fR\fB/\fR\fIpattern\fR\fR
453 .RS 13n
454 Search forward for the \fIi\|\fRth occurrence of the regular expression
455 \fIpattern\fR. Display the screenful starting two lines before the line that
456 contains the \fIi\|\fRth match for the regular expression \fIpattern\fR, or the
457 end of a pipe, whichever comes first. If \fBmore\fR is displaying a file and
458 there is no match, its position in the file remains unchanged. Regular
459 expressions can be edited using erase and kill characters. Erasing back past
460 the first column cancels the search command.
464 .ne 2
466 \fB\fB!\fR\fIcommand\fR\fR
468 .RS 13n
469 Invoke a shell to execute \fIcommand\|\fR. The characters \fB%\fR and \fB!\fR,
470 when used within \fIcommand\fR are replaced with the current filename and the
471 previous shell command, respectively. If there is no current filename, \fB%\fR
472 is not expanded. Prepend a backslash to these characters to escape expansion.
476 .ne 2
478 \fB\fB:f\fR\fR
480 .RS 13n
481 Display the current filename and line number.
485 .ne 2
487 \fB\fIi\fR\fB:n\fR\fR
489 .RS 13n
490 Skip to the \fIi\|\fRth next filename given in the command line, or to the last
491 filename in the list if \fIi\fR is out of range.
495 .ne 2
497 \fB\fIi\fR\fB:p\fR\fR
499 .RS 13n
500 Skip to the \fIi\|\fRth previous filename given in the command line, or to the
501 first filename if \fIi\fR is out of range. If given while \fBmore\fR is
502 positioned within a file, go to the beginning of the file. If \fBmore\fR is
503 reading from a pipe, \fBmore\fR simply rings the terminal bell.
507 .ne 2
509 \fB\fB:q\fR\fR
513 \fB\fB:Q\fR\fR
515 .RS 13n
516 Exit from \fBmore\fR (same as \fBq\fR or \fBQ\fR).
519 .SS "/usr/bin/more"
522 The following commands are available only in \fB/usr/bin/more\fR:
524 .ne 2
526 \fB\fB\&'\fR\fR
528 .RS 9n
529 Single quote. Go to the point from which the last search started. If no search
530 has been performed in the current file, go to the beginning of the file.
534 .ne 2
536 \fB\fB\&.\fR\fR
538 .RS 9n
539 Dot. Repeat the previous command.
543 .ne 2
545 \fB\fB^\|\e\fR\fR
547 .RS 9n
548 Halt a partial display of text. \fBmore\fR stops sending output, and displays
549 the usual \fB--More--\fR prompt. Some output is lost as a result.
552 .SS "/usr/xpg4/bin/more"
555 The following commands are available only in \fB/usr/xpg4/bin/more\fR:
557 .ne 2
559 \fB\fIi\fR\fB^F\fR\fR
561 .RS 17n
562 (Control-f) Skip \fIi\fR screens full and print a screenful. (Same as
563 \fIi\fR\fBf\fR.)
567 .ne 2
569 \fB\fB^G\fR\fR
571 .RS 17n
572 (Control-g) Display the current line number (same as \fB=\fR).
576 .ne 2
578 \fB\fIi\fR\fBg\fR\fR
580 .RS 17n
581 Go to line number \fIi\fR with the default of the first line in the file.
585 .ne 2
587 \fB\fIi\fR\fBG\fR\fR
589 .RS 17n
590 Go to line number \fIi\fR with the default of the Last line in the file.
594 .ne 2
596 \fB\fIi\fR\fBj\fR\fR
598 .RS 17n
599 Display another line, or \fIi\fR more lines, if specified. (Same as
600 \fIi\fRRETURN.)
604 .ne 2
606 \fB\fIi\fR\fBk\fR\fR
608 .RS 17n
609 Scroll backwards one or \fIi\fR lines, if specified.
613 .ne 2
615 \fB\fBm\fR\fIletter\fR \fR
617 .RS 17n
618 Mark the current position with the name \fIletter\fR.
622 .ne 2
624 \fB\fBN\fR \fR
626 .RS 17n
627 Reverse direction of search.
631 .ne 2
633 \fB\fBr\fR \fR
635 .RS 17n
636 Refresh the screen.
640 .ne 2
642 \fB\fBR\fR \fR
644 .RS 17n
645 Refresh the screen, discarding any buffered input.
649 .ne 2
651 \fB\fIi\fR\fBu\fR\fR
655 \fB\fIi\fR\fB^U\fR\fR
657 .RS 17n
658 (Control-u) Scroll backwards one half a screen of \fIi\fR lines, if specified.
659 If \fIi\fR is specified, the count becomes the new default for subsequent
660 \fBd\fR and \fBu\fR commands.
664 .ne 2
666 \fB\fBZZ\fR \fR
668 .RS 17n
669 Exit from \fBmore\fR (same as \fBq\fR).
673 .ne 2
675 \fB\fB:e\fR \fIfile\fR \fR
677 .RS 17n
678 Examine (display) a new file. If no \fIfile\fR is specified, the current file
679 is redisplayed.
683 .ne 2
685 \fB\fB:t\fR \fItagstring\fR \fR
687 .RS 17n
688 Go to the tag named by the \fItagstring\fR argument and scroll/rewrite the
689 screen with the tagged line in the current position. See the \fBctags\fR
690 utility.
694 .ne 2
696 \fB\fB\&'\fR\fIletter\fR \fR
698 .RS 17n
699 Return to the position that was previously marked with the name \fIletter\fR.
703 .ne 2
705 \fB\fB\&''\fR \fR
707 .RS 17n
708 Return to the position from which the last move of more than a screenful was
709 made. Defaults to the beginning of the file.
713 .ne 2
715 \fB\fIi\fR\fB?\fR[\fI!\fR]\fIpattern\fR\fR
717 .RS 17n
718 Search backward in the file for the \fIi\fRth line containing the
719 \fIpattern\fR. The \fI!\fR specifies to search backward for the \fIi\fRth line
720 that does not contain the \fIpattern\fR.
724 .ne 2
726 \fB\fIi\fR\fB/\fR\fB!\fR\fIpattern\fR\fR
728 .RS 17n
729 Search forward in the file for the \fIi\fRth line that does not contain the
730 pattern.
734 .ne 2
736 \fB\fB!\fR[\fIcommand\fR]\fR
738 .RS 17n
739 Invoke a shell or the specified command.
742 .SS "Large File Behavior"
745 See \fBlargefile\fR(5) for the description of the behavior of \fBmore\fR and
746 \fBpage\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
747 bytes).
748 .SH ENVIRONMENT VARIABLES
751 See \fBenviron\fR(5) for descriptions of the following environment variables
752 that affect the execution of \fBmore\fR: \fBLANG\fR, \fBLC_ALL\fR,
753 \fBLC_COLLATE\fR (\fB/usr/xpg4/bin/more\fR only), \fBLC_CTYPE\fR,
754 \fBLC_MESSAGES\fR, \fBNLSPATH\fR, and \fBTERM\fR.
755 .SS "/usr/xpg4/bin/more"
758 The following environment variables also affect the execution of
759 \fB/usr/xpg4/bin/more\fR:
761 .ne 2
763 \fB\fBCOLUMNS\fR \fR
765 .RS 12n
766 Overrides the system selected horizontal screen size.
770 .ne 2
772 \fB\fBEDITOR\fR \fR
774 .RS 12n
775 Used by the \fBv\fR command to select an editor.
779 .ne 2
781 \fB\fBLINES\fR \fR
783 .RS 12n
784 Overrides the system selected vertical screen size. The \fB-n\fR option has
785 precedence over \fBLINES\fR in determining the number of lines in a screen.
789 .ne 2
791 \fB\fBMORE\fR \fR
793 .RS 12n
794 A string specifying options as described in the OPTIONS section, above. As in a
795 command line, The options must be separated by blank characters and each option
796 specification must start with a \(mi. Any command line options are processed
797 after those specified in \fBMORE\fR as though the command line were: \fBmore
798 $MORE\fR \fIoptions operands\fR
801 .SH EXIT STATUS
804 The following exit values are returned:
806 .ne 2
808 \fB\fB0\fR \fR
810 .RS 7n
811 Successful completion.
815 .ne 2
817 \fB\fB>0\fR \fR
819 .RS 7n
820 An error occurred.
823 .SH FILES
825 .ne 2
827 \fB\fB/usr/lib/more.help\fR\fR
829 .RS 22n
830 help file for \fB/usr/bin/more\fR and  \fB/usr/bin/page\fR only.
833 .SH ATTRIBUTES
836 See \fBattributes\fR(5) for descriptions of the following attributes:
837 .SS "/usr/bin/more /usr/bin/page"
842 box;
843 c | c
844 l | l .
845 ATTRIBUTE TYPE  ATTRIBUTE VALUE
847 CSI     Not enabled
850 .SS "/usr/xpg4/bin/more"
855 box;
856 c | c
857 l | l .
858 ATTRIBUTE TYPE  ATTRIBUTE VALUE
860 CSI     Enabled
862 Interface Stability     Standard
865 .SH SEE ALSO
868 \fBcat\fR(1), \fBcsh\fR(1), \fBctags\fR(1), \fBman\fR(1), \fBnroff\fR(1),
869 \fBscript\fR(1), \fBsh\fR(1), \fBul\fR(1), \fBterminfo\fR(4),
870 \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
871 .SS "/usr/bin/more /usr/bin/page"
874 \fBregcomp\fR(3C)
875 .SS "/usr/xpg4/bin/more"
878 \fBregex\fR(5)
879 .SH NOTES
880 .SS "/usr/bin/more"
883 Skipping backwards is too slow on large files.
884 .SS "/usr/xpg4/bin/more"
887 This utility will not behave correctly if the terminal is not set up properly.