More (command)
| Company type | Utility / Command |
|---|---|
| Industry | Computing / Software |
| Founded | 1978 |
| Founder | Daniel Halbert |
| Headquarters | Berkeley, California , United States |
| Products | Text file viewer / pager utility |
In the realm of computing, the more command serves as a utility for viewing text files incrementally, displaying content one screen at a time without permitting modifications. This command is available across various operating systems including Unix and its derivatives, DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows, and ReactOS. Such utilities are commonly referred to as pagers. Initially designed to allow only forward scrolling through a file, modern implementations have introduced limited capabilities for backward navigation.
History
The origin of the more command traces back to 1978 when Daniel Halbert developed it at the University of California, Berkeley. Subsequent enhancements were contributed by Eric Shienbrood and Geoff Peck, who added features such as underlining and single-spacing, while John Foderaro introduced the -c option along with support for environment variables. The command was first bundled with 3.0 BSD and subsequently became a standard component in Unix systems. A related pager named less, which supports both forward and backward movement through files, was created by Mark Nudelman between 1983 and 1985 and has since become widely adopted on Unix-like platforms.
The more command has been incorporated into MS-DOS starting from version 2. ASCII Corporation included it in MSX-DOS2 Tools for MSX-DOS version 2. The Software Link’s PC-MOS offers a GPL v3 licensed version of the utility. FreeDOS features an iteration developed by Jim Hall under the GPL v2 license. Additionally, it is included within the KolibriOS Shell environment.
In numerical computing platforms such as MATLAB and GNU Octave, a more function exists to enable or disable output pagination.
Unix-like
The general form of the command is:
more [options] [file_name]
When no file argument is specified, more reads input from standard input.
The command presents as much text as fits on one screen and pauses awaiting user interaction before continuing. A form feed character (^L) also triggers a pause. Progress is indicated at the bottom left corner with the prompt "--More--" along with a percentage reflecting how much of the file has been viewed. Upon reaching the end (100%), more terminates. Users typically navigate using Enter to advance one line or Space to move forward by one screen. Further command options are documented in the more manpage.
Options
Options may be specified before the file name or configured via the $MORE environment variable; however, command-line parameters take precedence over environment settings. Frequently used options include:
- -num: Defines the number of lines per screen.
- -d: Displays prompt "[Press space to continue, 'q' to quit.]" and provides help messages instead of sounding a bell on invalid input.
- -l: Disables pausing upon encountering form feed (^L) characters.
- -f: Counts logical lines rather than screen lines (disables line folding).
- -p: Clears the screen instead of scrolling when advancing.
- -c: Redraws each screen from the top while clearing remaining lines.
- -s: Collapses multiple consecutive blank lines into one.
- -u: Treats backspace and carriage return characters as printable text.
- +/: Searches for a specified string before beginning display (e.g., more +/Preamble gpl.txt).
- +num: Starts displaying from line number num.
Microsoft Windows and ReactOS
The syntax for these platforms is:
command | more [/c] [/p] [/s] [/tn] [+n] more [[/c] [/p] [/s] [/tn] [+n]] < [Drive:] [Path] FileName more [/c] [/p] [/s] [/tn] [+n] [files]
Available options include:
- /c: Clears the screen prior to output display.
- /p: Pauses after each full screen of output.
- /s: Compresses sequences of blank lines into a single line.
- /tn: Sets tabulation size.
- +n: Begins displaying output starting at line number n.
Illustrations
To view the contents of the file letter.txt on the display, users may utilize either of the following commands:
more letter.txt type letter.txt | more
This command reveals the initial screenful of the file and then displays the prompt:
-- More—Pressing the spacebar advances to the subsequent screen.
Additionally, users can remove extra blank lines and clear the screen before displaying the content by using:
more /c /s < letter.txt type letter.txt | more /c /s
IBM OS/2
Command format:
MORE < [drive:][path]filename command | more
drive:\path\filename– Indicates the file path to present content one screen at a time.command |– Specifies a command whose output is paginated.
Illustration
To paginate through the OS/2 system directory listing one screen at a time, use:
<syntaxhighlight lang="text"> [C:\]dir C:\OS2 | more </syntaxhighlight>
Related topics
Recommended reading
- Jim Cooper, Special Edition Using MS-DOS 6.22, Third Edition, Que Publishing, 2001
- Kathy Ivens & Brian Proffit, OS/2 Inside & Out, Osborne McGraw-Hill, 1993
- William R. Stanek, Windows Command-Line Administrator's Pocket Consultant, 2nd Edition, Microsoft Press, 2008
- Kirk McElhearn, The Mac OS X Command Line: Unix Under the Hood, John Wiley & Sons, 2006