more or page Command Purpose Displays continuous text one screen at a time on a display screen. Syntax { more | page } [ -c ] [ -d ] [ -f ] [ -l ] [ -s ] [ -u ] [ -n ] [ -p ] [ -v ] [ -w ] [ -z ] [ +Number | +/Pattern ] [ +g ] [ File ] Description The more command displays continuous text one screen at a time. It pauses after each screen and prints the word More at the bot- tom of the screen. If you then press a carriage return, the more command displays an additional line. If you press the space bar, the more command displays another screen of text. Note: On some terminal models, the more command clears the screen, instead of scrolling, before displaying the next screen of data. Flags -c Keeps the screen from scrolling and makes it easier to read text while the more command is writing to the terminal. The -c flag is ignored if the terminal does not have the ability to clear to the end of a line. -d Prompts the user to continue, quit, or obtain help. -f Causes the more command to count logical lines, rather than screen lines. The -f flag is recommended if the nroff command is being piped through the ul command. -l Does not treat the \^L (form-feed) character in a special manner. If the -l flag is not supplied, the more command pauses after any line that contains a \^L, as though a full screen of text has been reached. If a file begins with a form-feed charac- ter, the screen is cleared before the file is printed. -n Specifies an integer that is the number of lines in the win- dow. If the -n flag is not specified, the more command uses the default number. -p Disables scrolling so that the screen is cleared before the next screen of text is displayed. -s Squeezes multiple blank lines from the output to produce only one blank line. The -s flag is particularly helpful when viewing output from the nroff command. This flag maximizes the useful information present on the screen. -u Prevents the more command from underlining or creating stand- out mode for underlined information in a source file. -v Prevents the display of nonprinting characters graphically. Without the -v flag, the more command displays all non-ASCII and most control characters (except Tab, Backspace, and Return). Without the -v flag, the more command displays non-ASCII charac- ters as M-x (for the non-ASCII character x) or \^X (for Ctrl-x). -w Keeps the current file open, even when it reaches the EOF (end of file). This allows you to page or scroll backward through the file. Normally, when the more command reads an EOF, it displays the next file specified on the command line or exits if no more files are specified. When using the more command to read from a growing file or from a pipe, the -w flag allows you to poll to display any new text that has been appended to the file or pipe. -z Displays additional control characters. \^H represents Back- space, \^M represents Return, and \^I represents Tab. +Number Starts at the line specified by the Number variable. If specified with +/Pattern, the +/Pattern takes priority. +g Displays the last screen in the file and allows you to scroll backward through the file, rather than forcing an exit. See also the -w flag. +/Pattern Starts on the line containing the specified regular ex- pression pattern. The more command uses descriptions found in the /usr/share/lib/terminfo directory to determine terminal charac- teristics and the default window size. On a terminal capable of displaying 24 lines, the default window size is 22 lines. If the more command is reading from a file rather than a pipe, it displays a % (percent sign) with the more command prompt. This provides the fraction of the file (in characters, not lines) that the more command has read. The page command is equivalent to the more command. If the pro- gram is invoked using the page command, the screen is cleared be- fore each screen is printed (only if a full screen is being printed). In this instance, the page command prints K-1 lines rather than K-2 lines, where K is the number of lines the termi- nal can display. Command Sequences Additional command sequences can be entered when the more command pauses. Most commands can be preceded by an optional integer, symbolized by K. K defaults to 1 unless otherwise specified. The following command sequences are available: K(Spacebar) Displays K more lines of text when the spacebar is pressed. If no value is given for K, a full screen of text is displayed when the Spacebar is pressed. \^D Displays the next 11 lines (a "scroll"). If K is given, the scroll size is set to the number of lines indicated for K. This sequence is the same as d. Kd Displays 11 more lines (a "scroll"). If K is given, the scroll size is set to the number of lines indicated for K. This sequence is the same as \^D (Ctrl-D). Kz or z Sets a new default window size K lines long. If no value is given for K, this command is equivalent to the (Spacebar) com- mand. Ks Skips forward the number of lines specified for K and prints a full screen of lines. If no value is given for K, the default is one line at a time. Kf Skips forward the number of screens specified for K and prints a full screen of lines. If no value is given for K, the default is one screen at a time. Kb Skips backwards K number of screens and prints a full screen of lines. If no value is given for K, the default is one screen at a time. This sequence is equivalent to K\^B. K\^B Skips backwards K number of screens and prints a full screen of lines. If no value is given for K, the default is one screen at a time. This sequence is equivalent to K\^b. q or Q Exit from the more command. = Displays the current line number. v Invokes the vi editor at the current line. h This is a help command. Provides a description for all of the more commands. K/Expression Searches for the specified (K) occurrence of the string of text following the / (slash). If there are fewer than K occurrences of the Expression and the input is a file (rather than a pipe), the position of the expression in the file display remains unchanged. Otherwise, a full screen is displayed, start- ing two lines prior to the location of the expression. Kn Searches for the Kth occurrence of the last regular expression entered. If no value is given for K, the default is one screen at a time. ' Goes to the point from which the last search started. If a search has not been performed in the current file, the ' (apos- trophe) causes the more command to go to the beginning of the file. !command or %command Invokes a shell. The characters % (percent) and ! (exclamation point) characters in the command sequence are replaced with the current file name and the previous shell com- mand, respectively. If there is no current file name, % is not expanded. The sequences \% (backslash, percent) and \! (backslash, exclamation point) are replaced by % and ! respec- tively. K:n Skips to the Kth file following in the command line. If n is not valid, this sequence skips to the last file. K:p Skips to the Kth previous file given in the command line. If this sequence is entered while the more command is printing a file, the command returns to the beginning of the file. If no value is given for K, the default is to return to the preceding file. :f Displays the current file name and line number. :q or :Q Exits from the more command. Same as q or Q. . (dot) Repeats the previous command. When any of the command sequences are entered, they begin to pro- cess immediately. It is not necessary to type a carriage return or to press the Enter key. The more command sets terminals to Noecho mode. This causes the output to be continuous and only displays the / and ! characters on your terminal as you type. If the standard output is not a terminal, the more command processes like the cat command. Exit Status This command returns the following exit values: 0 Successful completion. >0 An error occurred. Examples 1. To view a file named myfile, enter: more myfile During display of myfile, to change the number of lines shown on the screen, enter: 5z The 5z command causes the more command to scroll and display only 5 lines of text at a time. 2. To view output from the nroff command, enter: nroff -ms +2 doc.n | more -s Implementation Specifics This command is part of Base Operating System (BOS) Runtime. Files /usr/share/lib/terminfo Indicates the terminal information data- base. Related Information The cat command, csh command, ksh command, msgs command, script command. The environment file, terminfo file. Files Overview in AIX Version 3.2 System User's Guide: Operating System and Devices. Understanding File and Directory Access Modes in AIX Version 3.2 System Management Guide: Operating System and Devices. Input and Output Redirection Overview in AIX Version 3.2 System User's Guide: Operating System and Devices. Shells Overview in AIX Version 3.2 System User's Guide: Operat- ing System and Devices.