Linux more command details how to use Linux more command

Source: Internet
Author: User

The most basic command of more is to press space to display it on the next page. Press B to display it on the back page, in addition, the string search function (similar to vi) is provided. For instructions in use, Press h.

Syntax

More [-dlfpcsu] [-num] [+/pattern] [+ linenum] [fileNames...]

Parameters:

  • -Num: number of rows displayed at a time
  • -D prompts the user to Display [Press space to continue, 'Q' to quit.] at the bottom of the screen. if you Press the wrong key, [Press 'H' for instructions.] is displayed. instead of 'beeping'
  • -L cancel the function that will be paused when a special character ^ L (paper delivery character) is encountered
  • -F indicates the number of rows calculated based on the actual number of rows, rather than the number of rows after the automatic line feed (some rows with too long words will be extended to two or more rows)
  • -P does not display each page in a scroll mode, but clears the screen before displaying the content.
  • -C is similar to-p. The difference is that the content is displayed before other old data is cleared.
  • -S: if there are two or more blank rows in a row, it is replaced by a blank row.
  • -U does not display the quotation marks (it varies depending on the terminal specified by the environment variable TERM)
  • +/Pattern search for this string (pattern) before each document is displayed, and then display it after this string
  • + Num is displayed from row num.
  • The number of files fileNames want to display.

Instance

The content of the testfile document is displayed one by one. If there are two or more lines of blank lines in a row, the content is displayed as one line of blank lines.

More-s testfile

The document content of testfile is displayed starting from Line 1.

More + 20 testfile

Common Operation Commands

  • Enter down n rows, which need to be defined. The default value is 1 line.
  • Ctrl + F scroll down one screen
  • Space key scroll down one screen
  • Ctrl + B return to the previous screen
  • = Output the row number of the current row
  • : F output file name and the row number of the current row
  • V call vi editor
  • ! Command to call Shell and execute the command
  • Q: exit more.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.