More (command)

More (command)

In computing, more is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager).It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called "pagers". [ [http://foldoc.org/?pager foldoc.org/?pager] ] more is a very basic pager, originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement.

History

The more command was originally written by Daniel Halbert, a graduate student at the University of California, Berkeley, in 1978. 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 during 1983-85 and is now is included in most Unix and Unix-like systems.

Usage

Unix

The command-syntax is:

more [options] [file_name]

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

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. [man|cu|more|SUS|display files on a page-by-page basis]

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: Suppress underlining.
* +/: The +/ 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

The command-syntax is: [ [http://technet.microsoft.com/en-us/library/bb490933.aspx Microsoft TechNet More article] ]

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

OS/2

The command-syntax is:

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

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

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

* pg (Unix)
* less (Unix)

References

External links

* [http://foldoc.org/?pager "FOLDOC entry for pager"] ; see definition #2.
* [http://www.linuxmanpages.com/man1/more.1.php manpage of more]
* [http://www.halwitz.org/halbert/more.html Early history of the more command]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • more (command) — more Example output of the more command Developer(s) Daniel Halbert Operating system Cross platform …   Wikipedia

  • More — or Mores may refer to: More (surname), a family name, including a list of people with the surname Contents 1 Computers 2 Film 3 …   Wikipedia

  • More (Kommandozeilenbefehl) — more in einem X Terminal – links unten der hervorgehobene Bereich „ Mehr “. more (englisch mehr) ist ein Befehl auf der Kommandozeile zum Betrachten großer Datenmengen. more gibt den Text seitenweise auf der Kommandozeile aus, wobei die Ausgabe… …   Deutsch Wikipedia

  • Command Post Tango — (AKA CP TANGO),[1] is a 5 billion dollar top secret facility covering over 240 acres (0.97 km2) and over 8,500,000,000 square feet (790,000,000 m2) above and below ground military bunker U.S. Government real property. It is the Theater… …   Wikipedia

  • More (Unix) — more in einem X Terminal – links unten der hervorgehobene Bereich „ Mehr “. more (englisch mehr) ist ein Befehl auf der Kommandozeile zum Betrachten großer Datenmengen. more gibt den Text seitenweise auf der Kommandozeile aus, wobei die Ausgabe… …   Deutsch Wikipedia

  • Command & Conquer 3: Kane's Wrath — Developer(s) EA Los Angeles BreakAway Games[1] Publisher(s) …   Wikipedia

  • Command & Conquer: Generals — Command Conquer Generals cover art Developer(s) EA Pacific (Windows) Aspyr Media (Mac OS) …   Wikipedia

  • Command & Conquer: Red Alert 3 — Red Alert 3 cover art Developer(s) EA Los Angeles Publisher(s) Elect …   Wikipedia

  • command — vb Command, order, bid, enjoin, direct, instruct, charge mean to issue orders to someone to give, get, or do something. Command and order agree in stressing the idea of authority, command implying its more formal and official exercise {the… …   New Dictionary of Synonyms

  • Command & Conquer: Renegade — Developer(s) Westwood Studios Publisher(s) EA Games Se …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”