More (command)

In computing,   is a command to view (but not modify) the contents of a text file one screen at a time. It is available on Unix and Unix-like systems, DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows and ReactOS. Programs of this sort are called pagers. is a very basic pager, originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement.

History
The  command was originally written by Daniel Halbert, a graduate student at the University of California, Berkeley, in 1978. It was later expanded on by Eric Shienbrood, Geoff Peck (added underlining, single spacing) and John Foderaro (added -c,  environment variable  ). It was first included in 3.0 BSD, and has since become a standard program in all Unix systems. , a similar command with the extended capability of allowing both forward and backward navigation through the file, was written by Mark Nudelman between 1983 and 1985 and is now included in most Unix and Unix-like systems.

The command is available in MS-DOS versions 2 and later. A  command is also part of ASCII's MSX-DOS2 Tools for MSX-DOS version 2. The Software Link's PC-MOS includes an implementation of. Like the rest of the operating system, it is licensed under the GPL v3. The FreeDOS version was developed by Jim Hall and is licensed under the GPL v2. The command is also available in the KolibriOS Shell.

The numerical computing environments MATLAB and GNU Octave include a  function that turns output pagination on or off.

Unix-like
The command-syntax is:

more [options] [file_name]

If no file name is provided,  looks for input from standard input.

Once  has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause   to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that  has paged through. (This percentage includes the text displayed on the current screen.) When  reaches the end of a file (100%) it exits. The most common methods of navigating through a file are Enter, which advances the output by one line, and Space , which advances the output by one screen.

There are also other commands that can be used while navigating through the document; consult 's   page for more details.

Options
Options are typically entered before the file name, but can also be entered in the environment variable. Options entered in the actual command line will override those entered in the  environment variable. Available options may vary between Unix systems, but a typical set of options is as follows:


 * -num : This option specifies an integer which is the screen size (in lines).
 * -d :  will prompt the user with the message [Press space to continue, 'q' to quit.] and will display [Press 'h' for instructions.] instead of ringing the bell when an illegal key is pressed.
 * -l :  usually treats ^L (form feed) as a special character, and will pause after any line that contains a form feed.  The -l option will prevent this behavior.
 * -f : Causes  to count logical, rather than screen lines (i.e., long lines are not folded).
 * -p : Do not scroll. Instead, clear the whole screen and then display the text.
 * -c : Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed.
 * -s : Squeeze multiple blank lines into one.
 * -u : Backspaces and carriage returns to be treated as printable characters;
 * +/ : This option specifies a string that will be searched for before each file is displayed. (Ex.: more +/Preamble gpl.txt )
 * +num : Start at line number num.

Microsoft Windows and ReactOS
The command-syntax is:

command | more [/c] [/p] [/s] [/tn] [+n] more /c] [/p] [/s] [/tn] [+n < [Drive:] [Path] FileName more [/c] [/p] [/s] [/tn] [+n] [files]

Examples
To display the file named letter.txt on the screen, the user can type either of the following two commands:

more letter.txt type letter.txt | more

The command displays the first screen of information from letter.txt, and then the following prompt appears:

-- More—When the spacebar is pressed, the next screen of information will be displayed. It is also possible to clear the screen and remove all extra blank lines before displaying the file:

more /c /s < letter.txt type letter.txt | more /c /s

IBM OS/2
The command-syntax is:

MORE < [drive:][path]filename command | more


 * – Specifies the location of the file to display one screen at a time.
 * – Specifies the command whose output will be displayed.

Example
Return the content of the OS/2 system directory using the  command and display it one screen at a time using the   command: