Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

more (command)

From Wikipedia, the free encyclopedia
Terminal pager available on various operating systems
more
Example output of themore command
Original authorsDaniel Halbert
Eric Shienbrood
Geoff Peck[1]
John Foderaro[2]
DevelopersDR,Microsoft,IBM,Toshiba,TSL,Jim Hall
Initial release1978, 47–48 years ago
Written inMS-DOS,PC-MOS:x86 assembly language
FreeDOS,ReactOS:C
Operating systemCross-platform
TypeCommand
LicenseUnix, Unix-like:BSD License,CDDL
MS-DOS:MIT
FreeDOS, ReactOS:GPL v2
PC-MOS:GPL v3

Incomputing,more is acommand to view (but not modify) the contents of atext file one screen at a time. It is available onUnix andUnix-like systems,MS-DOS,[3]Digital ResearchFlexOS,[4]IBM/Toshiba4690 OS,[5] IBMOS/2,[6]Windows andReactOS.[7] Programs of this sort are calledpagers.[8]more is a very basic pager, originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement.

History

[edit]

Themore command was originally written by Daniel Halbert, a graduate student at theUniversity 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 variablehistory). It was first included in 3.0BSD, 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 inMS-DOS versions 2 and later.[9] Amore command is also part ofASCII'sMSX-DOS2 Tools forMSX-DOS version 2.[10]The Software Link'sPC-MOS includes an implementation ofmore.[11] Like the rest of the operating system, it is licensed under theGPL v3.[12] TheFreeDOS version was developed byJim Hall and is licensed under theGPL v2.[13] The command is also available in theKolibriOS Shell.[14]

Thenumerical computing environmentsMATLAB andGNU Octave include amore function that turns output pagination on or off.[15][16]

Usage

[edit]

Unix-like

[edit]

The command-syntax is:

more [options] [file_name]

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

Oncemore 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 causemore 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 thatmore has paged through. (This percentage includes the text displayed on the current screen.) Whenmore reaches the end of a file (100%) it exits. The most common methods of navigating through a file areEnter, which advances the output by one line, andSpace, which advances the output by one screen.

There are also other commands that can be used while navigating through the document; consultmore'sman page for more details.[17]

Options

[edit]

Options are typically entered before the file name, but can also be entered in theenvironment 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: Causesmore 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 numbernum.

Microsoft Windows and ReactOS

[edit]
TheReactOSmore command

The command-syntax is:[18]

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

Examples

[edit]

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

more letter.txttype 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.txttype letter.txt | more /c /s

IBM OS/2

[edit]

The command-syntax is:

MORE < [drive:][path]filenamecommand | more
  • drive:\path\filename – Specifies the location of the file to display one screen at a time.
  • command | – Specifies the command whose output will be displayed.

Example

[edit]

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

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

See also

[edit]

References

[edit]
  1. ^"Early history of the more command".Archived from the original on 2013-09-04. Retrieved2012-07-28.
  2. ^"more(1) — Linux manual pages".Archived from the original on 2020-06-10. Retrieved2020-06-10.
  3. ^"ibiblio.org FreeDOS Group -- FreeDOS Base".www.ibiblio.org.Archived from the original on 2019-03-30. Retrieved2018-07-22.
  4. ^"Users guide"(PDF). www.bitsavers.org. Archived fromthe original(PDF) on 2019-09-25. Retrieved2020-01-30.
  5. ^[1][dead link]
  6. ^"JaTomes Help - OS/2 Commands".www.jatomes.com. Archived fromthe original on 2019-04-14. Retrieved2019-07-28.
  7. ^"reactos/reactos".GitHub. 3 January 2022.Archived from the original on 11 December 2017. Retrieved28 July 2019.
  8. ^"pager from FOLDOC".foldoc.org.Archived from the original on 2020-01-30. Retrieved2020-01-30.
  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.Archived from the original on 4 May 2021. Retrieved28 July 2019.
  12. ^Jansen, Roeland (8 February 2018)."pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources".Archived from the original on 4 May 2021. Retrieved28 July 2019 – via GitHub.
  13. ^"ibiblio.org FreeDOS Package -- more (FreeDOS Base)".www.ibiblio.org.Archived from the original on 2018-10-22. Retrieved2018-11-13.
  14. ^"Shell - KolibriOS wiki".wiki.kolibrios.org.Archived from the original on 2019-02-11. Retrieved2019-03-25.
  15. ^"Control paged output in Command Window - MATLAB more".www.mathworks.com.Archived from the original on 2019-04-06. Retrieved2019-04-06.
  16. ^"Function Reference: more".octave.sourceforge.io.Archived from the original on 2019-02-02. Retrieved2019-04-06.
  17. ^more: display files on a page-by-page basis – Shell and Utilities Reference,The Single UNIX Specification, Version 5 fromThe Open Group
  18. ^"More".docs.microsoft.com.

Further reading

[edit]

External links

[edit]
Wikibooks has a book on the topic of:Guide to Windows Commands
The WikibookGuide to Unix has a page on the topic of:Commands
File system
Processes
User environment
Text processing
Shell builtins
Searching
Documentation
Software development
Miscellaneous
Ecosystem
Interpreters
Terminals
File system navigation
File management
Archiving
Disk management
Processes
Registry
User environment
File contents
Scripting
Networking
Maintenance and care
Boot management
Software development
Miscellaneous
Retrieved from "https://en.wikipedia.org/w/index.php?title=More_(command)&oldid=1336332995"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp