More (command)

Last updated
more
Original author(s) Daniel Halbert, Eric Shienbrood, Geoff Peck, [1] John Foderaro [2]
Developer(s) DR, Microsoft, IBM, Toshiba, TSL, Jim Hall
Initial release1978, 4546 years ago
Written in MS-DOS, PC-MOS: x86 assembly language
FreeDOS, ReactOS: C
Operating system Cross-platform
Type Command
License Unix, Unix-like: BSD License, CDDL
MS-DOS: MIT
FreeDOS, ReactOS: GPL v2
PC-MOS: GPL v3

In computing, more 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, [3] Digital Research FlexOS, [4] IBM/Toshiba 4690 OS, [5] IBM OS/2, [6] Microsoft Windows and ReactOS. [7] Programs of this sort are called pagers. [8] more is a very basic pager, originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement.

Contents

History

The more 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, more environment variable history ). It was first included in 3.0 BSD, and has since become a standard program in all Unix systems. less , 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. [9] A more command is also part of ASCII's MSX-DOS2 Tools for MSX-DOS version 2. [10] The Software Link's PC-MOS includes an implementation of more. [11] Like the rest of the operating system, it is licensed under the GPL v3. [12] The FreeDOS version was developed by Jim Hall and is licensed under the GPL v2. [13] The command is also available in the KolibriOS Shell. [14]

The numerical computing environments MATLAB and GNU Octave include a more function that turns output pagination on or off. [15] [16]

Usage

Unix-like

The command-syntax is:

more [options] [file_name]

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

Once more 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 more 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 more has paged through. (This percentage includes the text displayed on the current screen.) When more 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 more's man page for more details. [17]

Options

Options are typically entered before the file name, but can also be entered in the environment variable $MORE. Options entered in the actual command line will override those entered in the $MORE 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: more 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: more 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 more 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 ReactOS more command ReactOS-0.4.13 more command 667x434.png
The ReactOS more command

The command-syntax is: [18]

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

Example

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

[C:\]dir C:\OS2 | more 

See also

Related Research Articles

uniq is a utility command on Unix, Plan 9, Inferno, and Unix-like operating systems which, when fed a text file or standard input, outputs the text with adjacent identical lines collapsed to one, unique line of text.

ls Command to list files and directories in Unix and Unix-like operating systems

In computing, ls is a command to list computer files and directories in Unix and Unix-like operating systems. It is specified by POSIX and the Single UNIX Specification.

cd (command) Computer command in various operating systems

The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

dir (command) Directory information command on various operating systems

In computing, dir (directory) is a command in various computer operating systems used for computer file and directory listing. It is one of the basic commands to help navigate the file system. The command is usually implemented as an internal command in the command-line interpreter (shell). On some systems, a more graphical representation of the directory structure can be displayed using the tree command.

In computing, a command is a directive to a computer program to perform a specific task. It may be issued via a command-line interface or as input to a network service as part of a network protocol, or as an event triggered in a graphical user interface.

tr (Unix) Unix text formatting utility

tr is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. It is an abbreviation of translate or transliterate, indicating its operation of replacing or removing specific characters in its input data set.

wc (Unix) Unix command utility

wc is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. The program reads either standard input or a list of computer files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.

less (Unix) Terminal pager

less is a terminal pager program on Unix, Windows, and Unix-like systems used to view the contents of a text file one screen at a time. It is similar to more, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, less does not need to read the entire file before starting, allowing for immediate viewing regardless of file size.

tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.

In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.

In computing, sleep is a command in Unix, Unix-like and other operating systems that suspends program execution for a specified time.

tree (command) Shell command in various operating systems

In computing, tree is a recursive directory listing command or program that produces a depth-indented listing of files. Originating in PC- and MS-DOS, it is found in Digital Research FlexOS, IBM/Toshiba 4690 OS, PTS-DOS, FreeDOS, IBM OS/2, Microsoft Windows, and ReactOS. A version for Unix and Unix-like systems is also available.

<span class="mw-page-title-main">TYPE (DOS command)</span>

In computing, type is a command in various command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell used to display the contents of specified files on the computer terminal. The analogous Unix command is cat.

<span class="mw-page-title-main">PRINT (command)</span> Computing command

In computing, the print command provides single-user print spooling capability in a number of operating systems. It is roughly similar to that provided by the UNIX System V lp and BSD lpr print spooler systems.

find (Windows)

In computing, find is a command in the command-line interpreters (shells) of a number of operating systems. It is used to search for a specific text string in a file or files. The command sends the specified lines to the standard output device.

In computing, label is a command included with some operating systems. It is used to create, change, or delete a volume label on a logical drive, such as a hard disk partition or a floppy disk. Used without parameters, label changes the current volume label or deletes the existing label.

help (command) Command in various command line shells

In computing, help is a command in various command line shells such as COMMAND.COM, cmd.exe, Bash, qshell, 4DOS/4NT, Windows PowerShell, Singularity shell, Python, MATLAB and GNU Octave. It provides online information about available commands and the shell environment.

copy (command)

In computing, copy is a command in various operating systems. The command copies computer files from one directory to another.

choice (command)

In computing, choice is a command that allows for batch files to prompt the user to select one item from a set of single-character choices. It is available in a number of operating system command-line shells.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternative to the non-interactive interface available with punched cards.

References

  1. Early history of the more command
  2. more(1) — Linux manual pages
  3. "ibiblio.org FreeDOS Group -- FreeDOS Base". www.ibiblio.org.
  4. "Users guide" (PDF). www.bitsavers.org. Retrieved 2020-01-30.
  5. [ dead link ]
  6. "JaTomes Help - OS/2 Commands". www.jatomes.com.
  7. "reactos/reactos". GitHub. 3 January 2022.
  8. "pager from FOLDOC". foldoc.org.
  9. Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN   0-7356-1812-7.
  10. MSX-DOS2 Tools User's Manual by ASCII Corporation
  11. "roelandjansen/pcmos386v501". GitHub. 2 January 2022.
  12. Jansen, Roeland (8 February 2018). "pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources" via GitHub.
  13. "ibiblio.org FreeDOS Package -- more (FreeDOS Base)". www.ibiblio.org.
  14. "Shell - KolibriOS wiki". wiki.kolibrios.org.
  15. "Control paged output in Command Window - MATLAB more". www.mathworks.com.
  16. "Function Reference: more". octave.sourceforge.io.
  17. more : display files on a page-by-page basis  Shell and Utilities Reference, The Single UNIX Specification , Version 4 from The Open Group
  18. "More". docs.microsoft.com.

Further reading