logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

more.1p (35822B)


  1. '\" et
  2. .TH MORE "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. more
  12. \(em display files on a page-by-page basis
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. more \fB[\fR-ceisu\fB] [\fR-n \fInumber\fB] [\fR-p \fIcommand\fB] [\fR-t \fItagstring\fB] [\fIfile\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR more
  21. utility shall read files and either write them to the terminal on a
  22. page-by-page basis or filter them to standard output. If standard
  23. output is not a terminal device, all input files shall be copied to
  24. standard output in their entirety, without modification, except as
  25. specified for the
  26. .BR \-s
  27. option. If standard output is a terminal device, the files shall be
  28. written a number of lines (one screenful) at a time under the control
  29. of user commands. See the EXTENDED DESCRIPTION section.
  30. .P
  31. Certain block-mode terminals do not have all the capabilities necessary
  32. to support the complete
  33. .IR more
  34. definition; they are incapable of accepting commands that are not
  35. terminated with a
  36. <newline>.
  37. Implementations that support such terminals shall provide an
  38. operating mode to
  39. .IR more
  40. in which all commands can be terminated with a
  41. <newline>
  42. on those terminals. This mode:
  43. .IP " *" 4
  44. Shall be documented in the system documentation
  45. .IP " *" 4
  46. Shall, at invocation, inform the user of the terminal deficiency that
  47. requires the
  48. <newline>
  49. usage and provide instructions on how this warning can be suppressed in
  50. future invocations
  51. .IP " *" 4
  52. Shall not be required for implementations supporting only fully capable
  53. terminals
  54. .IP " *" 4
  55. Shall not affect commands already requiring
  56. <newline>
  57. characters
  58. .IP " *" 4
  59. Shall not affect users on the capable terminals from using
  60. .IR more
  61. as described in this volume of POSIX.1\(hy2017
  62. .SH OPTIONS
  63. The
  64. .IR more
  65. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  66. .IR "Section 12.2" ", " "Utility Syntax Guidelines",
  67. except that
  68. .BR '\(pl'
  69. may be recognized as an option delimiter as well as
  70. .BR '\-' .
  71. .P
  72. The following options shall be supported:
  73. .IP "\fB\-c\fP" 10
  74. If a screen is to be written that has no lines in common with the
  75. current screen, or
  76. .IR more
  77. is writing its first screen,
  78. .IR more
  79. shall not scroll the screen, but instead shall redraw each line of the
  80. screen in turn, from the top of the screen to the bottom. In addition,
  81. if
  82. .IR more
  83. is writing its first screen, the screen shall be cleared. This option
  84. may be silently ignored on devices with insufficient terminal
  85. capabilities.
  86. .IP "\fB\-e\fP" 10
  87. Exit immediately after writing the last line of the last file in the
  88. argument list; see the EXTENDED DESCRIPTION section.
  89. .IP "\fB\-i\fP" 10
  90. Perform pattern matching in searches without regard to case; see the Base Definitions volume of POSIX.1\(hy2017,
  91. .IR "Section 9.2" ", " "Regular Expression General Requirements".
  92. .IP "\fB\-n\ \fInumber\fR" 10
  93. Specify the number of lines per screenful. The
  94. .IR number
  95. argument is a positive decimal integer. The
  96. .BR \-n
  97. option shall override any values obtained from any other source.
  98. .IP "\fB\-p\ \fIcommand\fR" 10
  99. Each time a screen from a new file is displayed or redisplayed
  100. (including as a result of
  101. .IR more
  102. commands; for example,
  103. .BR :p ),
  104. execute the
  105. .IR more
  106. command(s) in the command arguments in the order specified, as if
  107. entered by the user after the first screen has been displayed. No
  108. intermediate results shall be displayed (that is, if the command is a
  109. movement to a screen different from the normal first screen, only the
  110. screen resulting from the command shall be displayed.) If any of the
  111. commands fail for any reason, an informational message to this effect
  112. shall be written, and no further commands specified using the
  113. .BR \-p
  114. option shall be executed for this file.
  115. .IP "\fB\-s\fP" 10
  116. Behave as if consecutive empty lines were a single empty line.
  117. .IP "\fB\-t\ \fItagstring\fR" 10
  118. Write the screenful of the file containing the tag named by the
  119. .IR tagstring
  120. argument. See the
  121. .IR "\fIctags\fR\^"
  122. utility. The tags feature represented by
  123. .BR \-t
  124. .IR tagstring
  125. and the
  126. .BR :t
  127. command is optional. It shall be provided on any system that also
  128. provides a conforming implementation of
  129. .IR ctags ;
  130. otherwise, the use of
  131. .BR \-t
  132. produces undefined results.
  133. .RS 10
  134. .P
  135. The filename resulting from the
  136. .BR \-t
  137. option shall be logically added as a prefix to the list of command line
  138. files, as if specified by the user. If the tag named by the
  139. .IR tagstring
  140. argument is not found, it shall be an error, and
  141. .IR more
  142. shall take no further action.
  143. .P
  144. If the tag specifies a line number, the first line of the display shall
  145. contain the beginning of that line. If the tag specifies a pattern, the
  146. first line of the display shall contain the beginning of the matching
  147. text from the first line of the file that contains that pattern. If the
  148. line does not exist in the file or matching text is not found, an
  149. informational message to this effect shall be displayed, and
  150. .IR more
  151. shall display the default screen as if
  152. .BR \-t
  153. had not been specified.
  154. .P
  155. If both the
  156. .BR \-t
  157. .IR tagstring
  158. and
  159. .BR \-p
  160. .IR command
  161. options are given, the
  162. .BR \-t
  163. .IR tagstring
  164. shall be processed first; that is, the file and starting line for the
  165. display shall be as specified by
  166. .BR \-t ,
  167. and then the
  168. .BR \-p
  169. .IR more
  170. command shall be executed. If the line (matching text) specified by the
  171. .BR \-t
  172. command does not exist (is not found), no
  173. .BR \-p
  174. .IR more
  175. command shall be executed for this file at any time.
  176. .RE
  177. .IP "\fB\-u\fP" 10
  178. Treat a
  179. <backspace>
  180. as a printable control character, displayed as an
  181. implementation-defined character sequence (see the EXTENDED DESCRIPTION
  182. section), suppressing backspacing and the special handling that
  183. produces underlined or standout mode text on some terminal types.
  184. Also, do not ignore a
  185. <carriage-return>
  186. at the end of a line.
  187. .SH OPERANDS
  188. The following operand shall be supported:
  189. .IP "\fIfile\fR" 10
  190. A pathname of an input file. If no
  191. .IR file
  192. operands are specified, the standard input shall be used. If a
  193. .IR file
  194. is
  195. .BR '\-' ,
  196. the standard input shall be read at that point in the sequence.
  197. .SH STDIN
  198. The standard input shall be used only if no
  199. .IR file
  200. operands are specified, or if a
  201. .IR file
  202. operand is
  203. .BR '\-' .
  204. .SH "INPUT FILES"
  205. The input files being examined shall be text files. If standard output
  206. is a terminal, standard error shall be used to read commands from the
  207. user. If standard output is a terminal, standard error is not readable,
  208. and command input is needed,
  209. .IR more
  210. may attempt to obtain user commands from the controlling terminal (for
  211. example,
  212. .BR /dev/tty );
  213. otherwise,
  214. .IR more
  215. shall terminate with an error indicating that it was unable to read
  216. user commands. If standard output is not a terminal, no error shall
  217. result if standard error cannot be opened for reading.
  218. .SH "ENVIRONMENT VARIABLES"
  219. The following environment variables shall affect the execution of
  220. .IR more :
  221. .IP "\fICOLUMNS\fP" 10
  222. Override the system-selected horizontal display line size. See the Base Definitions volume of POSIX.1\(hy2017,
  223. .IR "Chapter 8" ", " "Environment Variables"
  224. for valid values and results when it is unset or null.
  225. .IP "\fIEDITOR\fP" 10
  226. Used by the
  227. .BR v
  228. command to select an editor. See the EXTENDED DESCRIPTION section.
  229. .IP "\fILANG\fP" 10
  230. Provide a default value for the internationalization variables that are
  231. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  232. .IR "Section 8.2" ", " "Internationalization Variables"
  233. for the precedence of internationalization variables used to determine
  234. the values of locale categories.)
  235. .IP "\fILC_ALL\fP" 10
  236. If set to a non-empty string value, override the values of all the
  237. other internationalization variables.
  238. .IP "\fILC_COLLATE\fP" 10
  239. .br
  240. Determine the locale for the behavior of ranges, equivalence classes,
  241. and multi-character collating elements within regular expressions.
  242. .IP "\fILC_CTYPE\fP" 10
  243. Determine the locale for the interpretation of sequences of bytes of
  244. text data as characters (for example, single-byte as opposed to
  245. multi-byte characters in arguments and input files) and the behavior of
  246. character classes within regular expressions.
  247. .IP "\fILC_MESSAGES\fP" 10
  248. .br
  249. Determine the locale that should be used to affect the format and
  250. contents of diagnostic messages written to standard error and
  251. informative messages written to standard output.
  252. .IP "\fINLSPATH\fP" 10
  253. Determine the location of message catalogs for the processing of
  254. .IR LC_MESSAGES .
  255. .IP "\fILINES\fP" 10
  256. Override the system-selected vertical screen size, used as the number
  257. of lines in a screenful. See the Base Definitions volume of POSIX.1\(hy2017,
  258. .IR "Chapter 8" ", " "Environment Variables"
  259. for valid values and results when it is unset or null. The
  260. .BR \-n
  261. option shall take precedence over the
  262. .IR LINES
  263. variable for determining the number of lines in a screenful.
  264. .IP "\fIMORE\fP" 10
  265. Determine a string containing options described in the OPTIONS section
  266. preceded with
  267. <hyphen-minus>
  268. characters and
  269. <blank>-separated
  270. as on the command line. Any command line options shall be processed
  271. after those in the
  272. .IR MORE
  273. variable, as if the command line were:
  274. .RS 10
  275. .sp
  276. .RS 4
  277. .nf
  278. more $MORE \fIoptions operands\fR
  279. .fi
  280. .P
  281. .RE
  282. .P
  283. The
  284. .IR MORE
  285. variable shall take precedence over the
  286. .IR TERM
  287. and
  288. .IR LINES
  289. variables for determining the number of lines in a screenful.
  290. .RE
  291. .IP "\fITERM\fP" 10
  292. Determine the name of the terminal type. If this variable is unset or
  293. null, an unspecified default terminal type is used.
  294. .SH "ASYNCHRONOUS EVENTS"
  295. Default.
  296. .SH STDOUT
  297. The standard output shall be used to write the contents of the input
  298. files.
  299. .SH STDERR
  300. The standard error shall be used for diagnostic messages and user
  301. commands (see the INPUT FILES section), and, if standard output is a
  302. terminal device, to write a prompting string. The prompting string
  303. shall appear on the screen line below the last line of the file
  304. displayed in the current screenful. The prompt shall contain the name
  305. of the file currently being examined and shall contain an end-of-file
  306. indication and the name of the next file, if any, when prompting at the
  307. end-of-file. If an error or informational message is displayed, it is
  308. unspecified whether it is contained in the prompt. If it is not
  309. contained in the prompt, it shall be displayed and then the user shall
  310. be prompted for a continuation character, at which point another
  311. message or the user prompt may be displayed. The prompt is otherwise
  312. unspecified. It is unspecified whether informational messages are
  313. written for other user commands.
  314. .SH "OUTPUT FILES"
  315. None.
  316. .SH "EXTENDED DESCRIPTION"
  317. The following section describes the behavior of
  318. .IR more
  319. when the standard output is a terminal device. If the standard output
  320. is not a terminal device, no options other than
  321. .BR \-s
  322. shall have any effect, and all input files shall be copied to standard
  323. output otherwise unmodified, at which time
  324. .IR more
  325. shall exit without further action.
  326. .P
  327. The number of lines available per screen shall be determined by the
  328. .BR \-n
  329. option, if present, or by examining values in the environment (see the
  330. ENVIRONMENT VARIABLES section). If neither method yields a number, an
  331. unspecified number of lines shall be used.
  332. .P
  333. The maximum number of lines written shall be one less than this number,
  334. because the screen line after the last line written shall be used to
  335. write a user prompt and user input. If the number of lines in the
  336. screen is less than two, the results are undefined. It is unspecified
  337. whether user input is permitted to be longer than the remainder of the
  338. single line where the prompt has been written.
  339. .P
  340. The number of columns available per line shall be determined by
  341. examining values in the environment (see the ENVIRONMENT VARIABLES
  342. section), with a default value as described in the Base Definitions volume of POSIX.1\(hy2017,
  343. .IR "Chapter 8" ", " "Environment Variables".
  344. .P
  345. Lines that are longer than the display shall be folded; the length at
  346. which folding occurs is unspecified, but should be appropriate for the
  347. output device. Folding may occur between glyphs of single characters
  348. that take up multiple display columns.
  349. .P
  350. When standard output is a terminal and
  351. .BR \-u
  352. is not specified,
  353. .IR more
  354. shall treat
  355. <backspace>
  356. and
  357. <carriage-return>
  358. characters specially:
  359. .IP " *" 4
  360. A character, followed first by a sequence of
  361. .IR n
  362. <backspace>
  363. characters (where
  364. .IR n
  365. is the same as the number of column positions that the character
  366. occupies), then by
  367. .IR n
  368. <underscore>
  369. characters (\c
  370. .BR '_' ),
  371. shall cause that character to be written as underlined text, if the
  372. terminal type supports that. The
  373. .IR n
  374. <underscore>
  375. characters, followed first by
  376. .IR n
  377. <backspace>
  378. characters, then any character with
  379. .IR n
  380. column positions, shall also cause that character to be written as
  381. underlined text, if the terminal type supports that.
  382. .IP " *" 4
  383. A sequence of
  384. .IR n
  385. <backspace>
  386. characters (where
  387. .IR n
  388. is the same as the number of column positions that the previous
  389. character occupies) that appears between two identical printable
  390. characters shall cause the first of those two characters to be written
  391. as emboldened text (that is, visually brighter, standout mode, or
  392. inverse-video mode), if the terminal type supports that, and the second
  393. to be discarded. Immediately subsequent occurrences of
  394. <backspace>/\c
  395. character pairs for that same character shall also be discarded. (For
  396. example, the sequence
  397. .BR \(dqa\eba\eba\eba\(dq
  398. is interpreted as a single emboldened
  399. .BR 'a' .)
  400. .IP " *" 4
  401. The
  402. .IR more
  403. utility shall logically discard all other
  404. <backspace>
  405. characters from the line as well as the character which precedes them,
  406. if any.
  407. .IP " *" 4
  408. A
  409. <carriage-return>
  410. at the end of a line shall be ignored, rather than being written as a
  411. non-printable character, as described in the next paragraph.
  412. .P
  413. It is implementation-defined how other non-printable characters are
  414. written. Implementations should use the same format that they use for
  415. the
  416. .IR ex
  417. .BR print
  418. command; see the OPTIONS section within the
  419. .IR ed
  420. utility. It is unspecified whether a multi-column character shall be
  421. separated if it crosses a display line boundary; it shall not be
  422. discarded. The behavior is unspecified if the number of columns on the
  423. display is less than the number of columns any single character in the
  424. line being displayed would occupy.
  425. .P
  426. When each new file is displayed (or redisplayed),
  427. .IR more
  428. shall write the first screen of the file. Once the initial screen has
  429. been written,
  430. .IR more
  431. shall prompt for a user command. If the execution of the user command
  432. results in a screen that has lines in common with the current screen,
  433. and the device has sufficient terminal capabilities,
  434. .IR more
  435. shall scroll the screen; otherwise, it is unspecified whether the
  436. screen is scrolled or redrawn.
  437. .P
  438. For all files but the last (including standard input if no file was
  439. specified, and for the last file as well, if the
  440. .BR \-e
  441. option was not specified), when
  442. .IR more
  443. has written the last line in the file,
  444. .IR more
  445. shall prompt for a user command. This prompt shall contain the name of
  446. the next file as well as an indication that
  447. .IR more
  448. has reached end-of-file. If the user command is
  449. .BR f ,
  450. <control>\(hyF,
  451. <space>,
  452. .BR j ,
  453. <newline>,
  454. .BR d ,
  455. <control>\(hyD,
  456. or
  457. .BR s ,
  458. .IR more
  459. shall display the next file. Otherwise, if displaying the last file,
  460. .IR more
  461. shall exit. Otherwise,
  462. .IR more
  463. shall execute the user command specified.
  464. .P
  465. Several of the commands described in this section display a previous
  466. screen from the input stream. In the case that text is being taken from
  467. a non-rewindable stream, such as a pipe, it is implementation-defined
  468. how much backwards motion is supported. If a command cannot be executed
  469. because of a limitation on backwards motion, an error message to this
  470. effect shall be displayed, the current screen shall not change, and the
  471. user shall be prompted for another command.
  472. .P
  473. If a command cannot be performed because there are insufficient lines
  474. to display,
  475. .IR more
  476. shall alert the terminal. If a command cannot be performed because
  477. there are insufficient lines to display or a
  478. .BR /
  479. command fails: if the input is the standard input, the last screen in
  480. the file may be displayed; otherwise, the current file and screen shall
  481. not change, and the user shall be prompted for another command.
  482. .P
  483. The interactive commands in the following sections shall be supported.
  484. Some commands can be preceded by a decimal integer, called
  485. .IR count
  486. in the following descriptions. If not specified with the command,
  487. .IR count
  488. shall default to 1. In the following descriptions,
  489. .IR pattern
  490. is a basic regular expression, as described in the Base Definitions volume of POSIX.1\(hy2017,
  491. .IR "Section 9.3" ", " "Basic Regular Expressions".
  492. The term ``examine'' is historical usage meaning ``open the
  493. file for viewing''; for example,
  494. .IR more
  495. .BR foo
  496. would be expressed as examining file
  497. .BR foo .
  498. .P
  499. In the following descriptions, unless otherwise specified,
  500. .IR line
  501. is a line in the
  502. .IR more
  503. display, not a line from the file being examined.
  504. .P
  505. In the following descriptions, the
  506. .IR "current position"
  507. refers to two things:
  508. .IP " 1." 4
  509. The position of the current line on the screen
  510. .IP " 2." 4
  511. The line number (in the file) of the current line on the screen
  512. .P
  513. Usually, the line on the screen corresponding to the current position
  514. is the third line on the screen. If this is not possible (there are
  515. fewer than three lines to display or this is the first page of the
  516. file, or it is the last page of the file), then the current position is
  517. either the first or last line on the screen as described later.
  518. .SS "Help"
  519. .IP "\fISynopsis\fR:" 10
  520. .sp -1v
  521. .RS 10
  522. .sp
  523. .RS 4
  524. .nf
  525. h
  526. .fi
  527. .P
  528. .RE
  529. .RE
  530. .P
  531. Write a summary of these commands and other implementation-defined
  532. commands. The behavior shall be as if the
  533. .IR more
  534. utility were executed with the
  535. .BR \-e
  536. option on a file that contained the summary information. The user shall
  537. be prompted as described earlier in this section when end-of-file is
  538. reached. If the user command is one of those specified to continue to
  539. the next file,
  540. .IR more
  541. shall return to the file and screen state from which the
  542. .BR h
  543. command was executed.
  544. .SS "Scroll Forward One Screenful"
  545. .IP "\fISynopsis\fR:" 10
  546. .sp -1v
  547. .RS 10
  548. .sp
  549. .RS 4
  550. .nf
  551. \fB[\fIcount\fB]\fRf
  552. \fB[\fIcount\fB]\fR<control>-F
  553. .fi
  554. .P
  555. .RE
  556. .RE
  557. .P
  558. Scroll forward
  559. .IR count
  560. lines, with a default of one screenful. If
  561. .IR count
  562. is more than the screen size, only the final screenful shall be
  563. written.
  564. .SS "Scroll Backward One Screenful"
  565. .IP "\fISynopsis\fR:" 10
  566. .sp -1v
  567. .RS 10
  568. .sp
  569. .RS 4
  570. .nf
  571. \fB[\fIcount\fB]\fRb
  572. \fB[\fIcount\fB]\fR<control>-B
  573. .fi
  574. .P
  575. .RE
  576. .RE
  577. .P
  578. Scroll backward
  579. .IR count
  580. lines, with a default of one screenful (see the
  581. .BR \-n
  582. option). If
  583. .IR count
  584. is more than the screen size, only the final screenful shall be
  585. written.
  586. .SS "Scroll Forward One Line"
  587. .IP "\fISynopsis\fR:" 10
  588. .sp -1v
  589. .RS 10
  590. .sp
  591. .RS 4
  592. .nf
  593. \fB[\fIcount\fB]\fR<space>
  594. \fB[\fIcount\fB]\fRj
  595. \fB[\fIcount\fB]\fR<newline>
  596. .fi
  597. .P
  598. .RE
  599. .RE
  600. .P
  601. Scroll forward
  602. .IR count
  603. lines. The default
  604. .IR count
  605. for the
  606. <space>
  607. shall be one screenful; for
  608. .BR j
  609. and
  610. <newline>,
  611. one line. The entire
  612. .IR count
  613. lines shall be written, even if
  614. .IR count
  615. is more than the screen size.
  616. .SS "Scroll Backward One Line"
  617. .IP "\fISynopsis\fR:" 10
  618. .sp -1v
  619. .RS 10
  620. .sp
  621. .RS 4
  622. .nf
  623. \fB[\fIcount\fB]\fRk
  624. .fi
  625. .P
  626. .RE
  627. .RE
  628. .P
  629. Scroll backward
  630. .IR count
  631. lines. The entire
  632. .IR count
  633. lines shall be written, even if
  634. .IR count
  635. is more than the screen size.
  636. .SS "Scroll Forward One Half Screenful"
  637. .IP "\fISynopsis\fR:" 10
  638. .sp -1v
  639. .RS 10
  640. .sp
  641. .RS 4
  642. .nf
  643. \fB[\fIcount\fB]\fRd
  644. \fB[\fIcount\fB]\fR<control>-D
  645. .fi
  646. .P
  647. .RE
  648. .RE
  649. .P
  650. Scroll forward
  651. .IR count
  652. lines, with a default of one half of the screen size. If
  653. .IR count
  654. is specified, it shall become the new default for subsequent
  655. .BR d ,
  656. <control>\(hyD,
  657. and
  658. .BR u
  659. commands.
  660. .SS "Skip Forward One Line"
  661. .IP "\fISynopsis\fR:" 10
  662. .sp -1v
  663. .RS 10
  664. .sp
  665. .RS 4
  666. .nf
  667. \fB[\fIcount\fB]\fRs
  668. .fi
  669. .P
  670. .RE
  671. .RE
  672. .P
  673. Display the screenful beginning with the line
  674. .IR count
  675. lines after the last line on the current screen. If
  676. .IR count
  677. would cause the current position to be such that less than one
  678. screenful would be written, the last screenful in the file shall be
  679. written.
  680. .SS "Scroll Backward One Half Screenful"
  681. .IP "\fISynopsis\fR:" 10
  682. .sp -1v
  683. .RS 10
  684. .sp
  685. .RS 4
  686. .nf
  687. \fB[\fIcount\fB]\fRu
  688. \fB[\fIcount\fB]\fR<control>-U
  689. .fi
  690. .P
  691. .RE
  692. .RE
  693. .P
  694. Scroll backward
  695. .IR count
  696. lines, with a default of one half of the screen size. If
  697. .IR count
  698. is specified, it shall become the new default for subsequent
  699. .BR d ,
  700. <control>\-D,
  701. .BR u ,
  702. and
  703. <control>\-U
  704. commands. The entire
  705. .IR count
  706. lines shall be written, even if
  707. .IR count
  708. is more than the screen size.
  709. .SS "Go to Beginning of File"
  710. .IP "\fISynopsis\fR:" 10
  711. .sp -1v
  712. .RS 10
  713. .sp
  714. .RS 4
  715. .nf
  716. \fB[\fIcount\fB]\fRg
  717. .fi
  718. .P
  719. .RE
  720. .RE
  721. .P
  722. Display the screenful beginning with line
  723. .IR count .
  724. .SS "Go to End-of-File"
  725. .IP "\fISynopsis\fR:" 10
  726. .sp -1v
  727. .RS 10
  728. .sp
  729. .RS 4
  730. .nf
  731. \fB[\fIcount\fB]\fRG
  732. .fi
  733. .P
  734. .RE
  735. .RE
  736. .P
  737. If
  738. .IR count
  739. is specified, display the screenful beginning with the line
  740. .IR count .
  741. Otherwise, display the last screenful of the file.
  742. .SS "Refresh the Screen"
  743. .IP "\fISynopsis\fR:" 10
  744. .sp -1v
  745. .RS 10
  746. .sp
  747. .RS 4
  748. .nf
  749. r
  750. <control>-L
  751. .fi
  752. .P
  753. .RE
  754. .RE
  755. .P
  756. Refresh the screen.
  757. .SS "Discard and Refresh"
  758. .IP "\fISynopsis\fR:" 10
  759. .sp -1v
  760. .RS 10
  761. .sp
  762. .RS 4
  763. .nf
  764. R
  765. .fi
  766. .P
  767. .RE
  768. .RE
  769. .P
  770. Refresh the screen, discarding any buffered input. If the current file
  771. is non-seekable, buffered input shall not be discarded and the
  772. .BR R
  773. command shall be equivalent to the
  774. .BR r
  775. command.
  776. .SS "Mark Position"
  777. .IP "\fISynopsis\fR:" 10
  778. .sp -1v
  779. .RS 10
  780. .sp
  781. .RS 4
  782. .nf
  783. m\fIletter\fR
  784. .fi
  785. .P
  786. .RE
  787. .RE
  788. .P
  789. Mark the current position with the letter named by
  790. .IR letter ,
  791. where
  792. .IR letter
  793. represents the name of one of the lowercase letters of the portable
  794. character set. When a new file is examined, all marks may be lost.
  795. .SS "Return to Mark"
  796. .IP "\fISynopsis\fR:" 10
  797. .sp -1v
  798. .RS 10
  799. .sp
  800. .RS 4
  801. .nf
  802. \&\(aq\fIletter\fR
  803. .fi
  804. .P
  805. .RE
  806. .RE
  807. .P
  808. Return to the position that was previously marked with the letter named
  809. by
  810. .IR letter ,
  811. making that line the current position.
  812. .SS "Return to Previous Position"
  813. .IP "\fISynopsis\fR:" 10
  814. .sp -1v
  815. .RS 10
  816. .sp
  817. .RS 4
  818. .nf
  819. \&\(aq\(aq
  820. .fi
  821. .P
  822. .RE
  823. .RE
  824. .P
  825. Return to the position from which the last large movement command was
  826. executed (where a ``large movement'' is defined as any movement of more
  827. than a screenful of lines). If no such movements have been made, return
  828. to the beginning of the file.
  829. .SS "Search Forward for Pattern"
  830. .IP "\fISynopsis\fR:" 10
  831. .sp -1v
  832. .RS 10
  833. .sp
  834. .RS 4
  835. .nf
  836. \fB[\fIcount\fB]\fR/\fB[\fR!\fB]\fIpattern\fR<newline>
  837. .fi
  838. .P
  839. .RE
  840. .RE
  841. .P
  842. Display the screenful beginning with the
  843. .IR count th
  844. line containing the pattern. The search shall start after the first
  845. line currently displayed. The null regular expression (\c
  846. .BR '/'
  847. followed by a
  848. <newline>)
  849. shall repeat the search using the previous regular expression, with a
  850. default
  851. .IR count .
  852. If the character
  853. .BR '!'
  854. is included, the matching lines shall be those that do not contain the
  855. .IR pattern .
  856. If no match is found for the
  857. .IR pattern ,
  858. a message to that effect shall be displayed.
  859. .SS "Search Backward for Pattern"
  860. .IP "\fISynopsis\fR:" 10
  861. .sp -1v
  862. .RS 10
  863. .sp
  864. .RS 4
  865. .nf
  866. \fB[\fIcount\fB]\fR?\fB[\fR!\fB]\fIpattern\fR<newline>
  867. .fi
  868. .P
  869. .RE
  870. .RE
  871. .P
  872. Display the screenful beginning with the
  873. .IR count th
  874. previous line containing the pattern. The search shall start on the
  875. last line before the first line currently displayed. The null regular
  876. expression (\c
  877. .BR '?'
  878. followed by a
  879. <newline>)
  880. shall repeat the search using the previous regular expression, with a
  881. default
  882. .IR count .
  883. If the character
  884. .BR '!'
  885. is included, matching lines shall be those that do not contain the
  886. .IR pattern .
  887. If no match is found for the
  888. .IR pattern ,
  889. a message to that effect shall be displayed.
  890. .SS "Repeat Search"
  891. .IP "\fISynopsis\fR:" 10
  892. .sp -1v
  893. .RS 10
  894. .sp
  895. .RS 4
  896. .nf
  897. \fB[\fIcount\fB]\fRn
  898. .fi
  899. .P
  900. .RE
  901. .RE
  902. .P
  903. Repeat the previous search for
  904. .IR count th
  905. line containing the last
  906. .IR pattern
  907. (or not containing the last
  908. .IR pattern ,
  909. if the previous search was
  910. .BR \(dq/!\(dq
  911. or
  912. .BR \(dq?!\(dq ).
  913. .SS "Repeat Search in Reverse"
  914. .IP "\fISynopsis\fR:" 10
  915. .sp -1v
  916. .RS 10
  917. .sp
  918. .RS 4
  919. .nf
  920. \fB[\fIcount\fB]\fRN
  921. .fi
  922. .P
  923. .RE
  924. .RE
  925. .P
  926. Repeat the search in the opposite direction of the previous search for
  927. the
  928. .IR count th
  929. line containing the last
  930. .IR pattern
  931. (or not containing the last
  932. .IR pattern ,
  933. if the previous search was
  934. .BR \(dq/!\(dq
  935. or
  936. .BR \(dq?!\(dq ).
  937. .SS "Examine New File"
  938. .IP "\fISynopsis\fR:" 10
  939. .sp -1v
  940. .RS 10
  941. .sp
  942. .RS 4
  943. .nf
  944. :e \fB[\fIfilename\fB]\fR<newline>
  945. .fi
  946. .P
  947. .RE
  948. .RE
  949. .P
  950. Examine a new file. If the
  951. .IR filename
  952. argument is not specified, the current file (see the
  953. .BR :n
  954. and
  955. .BR :p
  956. commands below) shall be re-examined. The
  957. .IR filename
  958. shall be subjected to the process of shell word expansions (see
  959. .IR "Section 2.6" ", " "Word Expansions");
  960. if more than a single pathname results, the effects are unspecified.
  961. If
  962. .IR filename
  963. is a
  964. <number-sign>
  965. (\c
  966. .BR '#' ),
  967. the previously examined file shall be re-examined. If
  968. .IR filename
  969. is not accessible for any reason (including that it is a non-seekable
  970. file), an error message to this effect shall be displayed and the
  971. current file and screen shall not change.
  972. .SS "Examine Next File"
  973. .IP "\fISynopsis\fR:" 10
  974. .sp -1v
  975. .RS 10
  976. .sp
  977. .RS 4
  978. .nf
  979. \fB[\fIcount\fB]\fR:n
  980. .fi
  981. .P
  982. .RE
  983. .RE
  984. .P
  985. Examine the next file. If a number
  986. .IR count
  987. is specified, the
  988. .IR count th
  989. next file shall be examined. If
  990. .IR filename
  991. refers to a non-seekable file, the results are unspecified.
  992. .SS "Examine Previous File"
  993. .IP "\fISynopsis\fR:" 10
  994. .sp -1v
  995. .RS 10
  996. .sp
  997. .RS 4
  998. .nf
  999. \fB[\fIcount\fB]\fR:p
  1000. .fi
  1001. .P
  1002. .RE
  1003. .RE
  1004. .P
  1005. Examine the previous file. If a number
  1006. .IR count
  1007. is specified, the
  1008. .IR count th
  1009. previous file shall be examined. If
  1010. .IR filename
  1011. refers to a non-seekable file, the results are unspecified.
  1012. .SS "Go to Tag"
  1013. .IP "\fISynopsis\fR:" 10
  1014. .sp -1v
  1015. .RS 10
  1016. .sp
  1017. .RS 4
  1018. .nf
  1019. :t \fItagstring\fR<newline>
  1020. .fi
  1021. .P
  1022. .RE
  1023. .RE
  1024. .P
  1025. If the file containing the tag named by the
  1026. .IR tagstring
  1027. argument is not the current file, examine the file, as if the
  1028. .BR :e
  1029. command was executed with that file as the argument. Otherwise, or in
  1030. addition, display the screenful beginning with the tag, as described
  1031. for the
  1032. .BR \-t
  1033. option (see the OPTIONS section). If the
  1034. .IR ctags
  1035. utility is not supported by the system, the use of
  1036. .BR :t
  1037. produces undefined results.
  1038. .SS "Invoke Editor"
  1039. .IP "\fISynopsis\fR:" 10
  1040. .sp -1v
  1041. .RS 10
  1042. .sp
  1043. .RS 4
  1044. .nf
  1045. v
  1046. .fi
  1047. .P
  1048. .RE
  1049. .RE
  1050. .P
  1051. Invoke an editor to edit the current file being examined. If standard
  1052. input is being examined, the results are unspecified. The name of the
  1053. editor shall be taken from the environment variable
  1054. .IR EDITOR ,
  1055. or shall default to
  1056. .IR vi .
  1057. If the last pathname component in
  1058. .IR EDITOR
  1059. is either
  1060. .IR vi
  1061. or
  1062. .IR ex ,
  1063. the editor shall be invoked with a
  1064. .BR \-c
  1065. .IR linenumber
  1066. command line argument, where
  1067. .IR linenumber
  1068. is the line number of the file line containing the display line
  1069. currently displayed as the first line of the screen. It is
  1070. implementation-defined whether line-setting options are passed to
  1071. editors other than
  1072. .IR vi
  1073. and
  1074. .IR ex .
  1075. .P
  1076. When the editor exits,
  1077. .IR more
  1078. shall resume with the same file and screen as when the editor was
  1079. invoked.
  1080. .SS "Display Position"
  1081. .IP "\fISynopsis\fR:" 10
  1082. .sp -1v
  1083. .RS 10
  1084. .sp
  1085. .RS 4
  1086. .nf
  1087. =
  1088. <control>-G
  1089. .fi
  1090. .P
  1091. .RE
  1092. .RE
  1093. .P
  1094. Write a message for which the information references the first byte of
  1095. the line after the last line of the file on the screen. This message
  1096. shall include the name of the file currently being examined, its number
  1097. relative to the total number of files there are to examine, the line
  1098. number in the file, the byte number and the total bytes in the file,
  1099. and what percentage of the file precedes the current position. If
  1100. .IR more
  1101. is reading from standard input, or the file is shorter than a single
  1102. screen, the line number, the byte number, the total bytes, and the
  1103. percentage need not be written.
  1104. .SS "Quit"
  1105. .IP "\fISynopsis\fR:" 10
  1106. .sp -1v
  1107. .RS 10
  1108. .sp
  1109. .RS 4
  1110. .nf
  1111. q
  1112. :q
  1113. ZZ
  1114. .fi
  1115. .P
  1116. .RE
  1117. .RE
  1118. .P
  1119. Exit
  1120. .IR more .
  1121. .SH "EXIT STATUS"
  1122. The following exit values shall be returned:
  1123. .IP "\00" 6
  1124. Successful completion.
  1125. .IP >0 6
  1126. An error occurred.
  1127. .SH "CONSEQUENCES OF ERRORS"
  1128. If an error is encountered accessing a file when using the
  1129. .BR :n
  1130. command,
  1131. .IR more
  1132. shall attempt to examine the next file in the argument list, but the
  1133. final exit status shall be affected. If an error is encountered
  1134. accessing a file via the
  1135. .BR :p
  1136. command,
  1137. .IR more
  1138. shall attempt to examine the previous file in the argument list, but
  1139. the final exit status shall be affected. If an error is encountered
  1140. accessing a file via the
  1141. .BR :e
  1142. command,
  1143. .IR more
  1144. shall remain in the current file and the final exit status shall not be
  1145. affected.
  1146. .LP
  1147. .IR "The following sections are informative."
  1148. .SH "APPLICATION USAGE"
  1149. When the standard output is not a terminal, only the
  1150. .BR \-s
  1151. filter-modification option is effective. This is based on historical
  1152. practice. For example, a typical implementation of
  1153. .IR man
  1154. pipes its output through
  1155. .IR more
  1156. .BR \-s
  1157. to squeeze excess white space for terminal users. When
  1158. .IR man
  1159. is piped to
  1160. .IR lp ,
  1161. however, it is undesirable for this squeezing to happen.
  1162. .SH EXAMPLES
  1163. The
  1164. .BR \-p
  1165. allows arbitrary commands to be executed at the start of each file.
  1166. Examples are:
  1167. .IP "\fImore\ \fB\-p\ G\ \fIfile1\ file2\fR" 6
  1168. .br
  1169. Examine each file starting with its last screenful.
  1170. .IP "\fImore\ \fB\-p\ \fR100\ \fIfile1\ file2\fR" 6
  1171. .br
  1172. Examine each file starting with line 100 in the current position
  1173. (usually the third line, so line 98 would be the first line written).
  1174. .IP "\fImore\ \fB\-p\ \fR/100\ \fIfile1\ file2\fR" 6
  1175. .br
  1176. Examine each file starting with the first line containing the string
  1177. .BR \(dq100\(dq
  1178. in the current position
  1179. .SH RATIONALE
  1180. The
  1181. .IR more
  1182. utility, available in BSD and BSD-derived systems, was chosen as the
  1183. prototype for the POSIX file display program since it is more widely
  1184. available than either the public-domain program
  1185. .IR less
  1186. or than
  1187. .IR pg ,
  1188. a pager provided in System V. The 4.4 BSD
  1189. .IR more
  1190. is the model for the features selected; it is almost fully
  1191. upwards-compatible from the 4.3 BSD version in wide use and has become
  1192. more amenable for
  1193. .IR vi
  1194. users. Several features originally derived from various file editors,
  1195. found in both
  1196. .IR less
  1197. and
  1198. .IR pg ,
  1199. have been added to this volume of POSIX.1\(hy2017 as they have proved extremely popular with
  1200. users.
  1201. .P
  1202. There are inconsistencies between
  1203. .IR more
  1204. and
  1205. .IR vi
  1206. that result from historical practice. For example, the single-character
  1207. commands
  1208. .BR h ,
  1209. .BR f ,
  1210. .BR b ,
  1211. and
  1212. <space>
  1213. are screen movers in
  1214. .IR more ,
  1215. but cursor movers in
  1216. .IR vi .
  1217. These inconsistencies were maintained because the cursor movements are
  1218. not applicable to
  1219. .IR more
  1220. and the powerful functionality achieved without the use of the control
  1221. key justifies the differences.
  1222. .P
  1223. The tags interface has been included in a program that is not a text
  1224. editor because it promotes another degree of consistent operation with
  1225. .IR vi .
  1226. It is conceivable that the paging environment of
  1227. .IR more
  1228. would be superior for browsing source code files in some
  1229. circumstances.
  1230. .P
  1231. The operating mode referred to for block-mode terminals effectively
  1232. adds a
  1233. <newline>
  1234. to each Synopsis line that currently has none. So, for example,
  1235. .BR d \c
  1236. <newline>
  1237. would page one screenful. The mode could be triggered by a command
  1238. line option, environment variable, or some other method. The details
  1239. are not imposed by this volume of POSIX.1\(hy2017 because there are so few systems known to
  1240. support such terminals. Nevertheless, it was considered that all
  1241. systems should be able to support
  1242. .IR more
  1243. given the exception cited for this small community of terminals
  1244. because, in comparison to
  1245. .IR vi ,
  1246. the cursor movements are few and the command set relatively amenable to
  1247. the optional
  1248. <newline>
  1249. characters.
  1250. .P
  1251. Some versions of
  1252. .IR more
  1253. provide a shell escaping mechanism similar to the
  1254. .IR ex
  1255. .BR !
  1256. command. The standard developers did not consider that this was
  1257. necessary in a paginator, particularly given the wide acceptance of
  1258. multiple window terminals and job control features. (They chose to
  1259. retain such features in the editors and
  1260. .IR mailx
  1261. because the shell interaction also gives an opportunity to modify the
  1262. editing buffer, which is not applicable to
  1263. .IR more .)
  1264. .P
  1265. The
  1266. .BR \-p
  1267. (position) option replaces the
  1268. .BR +
  1269. command because of the Utility Syntax Guidelines. The
  1270. .BR \(pl \c
  1271. .IR command
  1272. option is no longer specified by POSIX.1\(hy2008 but may be present
  1273. in some implementations. In early proposals, it took a
  1274. .IR pattern
  1275. argument, but historical
  1276. .IR less
  1277. provided the
  1278. .IR more
  1279. general facility of a command. It would have been desirable to use the
  1280. same
  1281. .BR \-c
  1282. as
  1283. .IR ex
  1284. and
  1285. .IR vi ,
  1286. but the letter was already in use.
  1287. .P
  1288. The text stating ``from a non-rewindable stream .\|.\|. implementations
  1289. may limit the amount of backwards motion supported'' would allow an
  1290. implementation that permitted no backwards motion beyond text already
  1291. on the screen. It was not possible to require a minimum amount of
  1292. backwards motion that would be effective for all conceivable device
  1293. types. The implementation should allow the user to back up as far as
  1294. possible, within device and reasonable memory allocation constraints.
  1295. .P
  1296. Historically, non-printable characters were displayed using the ARPA
  1297. standard mappings, which are as follows:
  1298. .IP " 1." 4
  1299. Printable characters are left alone.
  1300. .IP " 2." 4
  1301. Control characters less than \e177 are represented as followed by the
  1302. character offset from the
  1303. .BR '@'
  1304. character in the ASCII map; for example, \e007 is represented as
  1305. .BR 'G' .
  1306. .IP " 3." 4
  1307. \e177 is represented as followed by
  1308. .BR '?' .
  1309. .P
  1310. The display of characters having their eighth bit set was less
  1311. standard. Existing implementations use hex (0x00), octal (\e000), and a
  1312. meta-bit display. (The latter displayed characters with their eighth
  1313. bit set as the two characters
  1314. .BR \(dqM-\(dq ,
  1315. followed by the seven-bit display as described previously.) The latter
  1316. probably has the best claim to historical practice because it was used
  1317. with the
  1318. .BR \-v
  1319. option of 4 BSD and 4 BSD-derived versions of the
  1320. .IR cat
  1321. utility since 1980.
  1322. .P
  1323. No specific display format is required by POSIX.1\(hy2008. Implementations are
  1324. encouraged to conform to historic practice in the absence of any strong
  1325. reason to diverge.
  1326. .SH "FUTURE DIRECTIONS"
  1327. None.
  1328. .SH "SEE ALSO"
  1329. .IR "Chapter 2" ", " "Shell Command Language",
  1330. .IR "\fIctags\fR\^",
  1331. .IR "\fIed\fR\^",
  1332. .IR "\fIex\fR\^",
  1333. .IR "\fIvi\fR\^"
  1334. .P
  1335. The Base Definitions volume of POSIX.1\(hy2017,
  1336. .IR "Chapter 8" ", " "Environment Variables",
  1337. .IR "Section 9.2" ", " "Regular Expression General Requirements",
  1338. .IR "Section 9.3" ", " "Basic Regular Expressions",
  1339. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  1340. .\"
  1341. .SH COPYRIGHT
  1342. Portions of this text are reprinted and reproduced in electronic form
  1343. from IEEE Std 1003.1-2017, Standard for Information Technology
  1344. -- Portable Operating System Interface (POSIX), The Open Group Base
  1345. Specifications Issue 7, 2018 Edition,
  1346. Copyright (C) 2018 by the Institute of
  1347. Electrical and Electronics Engineers, Inc and The Open Group.
  1348. In the event of any discrepancy between this version and the original IEEE and
  1349. The Open Group Standard, the original IEEE and The Open Group Standard
  1350. is the referee document. The original Standard can be obtained online at
  1351. http://www.opengroup.org/unix/online.html .
  1352. .PP
  1353. Any typographical or formatting errors that appear
  1354. in this page are most likely
  1355. to have been introduced during the conversion of the source files to
  1356. man page format. To report such errors, see
  1357. https://www.kernel.org/doc/man-pages/reporting_bugs.html .