English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux more command

Linux Command大全

The Linux more command is similar to cat, but it displays content page by page, which is more convenient for users to read page by page. The most basic command is to press the space key (space) to display the next page, press the b key to display one page back, and it also has the function of searching for strings (similar to vi). For usage instructions, press h.

Syntax

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

Parameters:

  • -num The number of lines displayed at one time
  • -d Tips the user, displays [Press space to continue, 'q' to quit.] at the bottom of the screen, and if the user presses the wrong key, it will display [Press 'h' for instructions.] instead of the 'beep' sound
  • -l Cancel the function of pausing when encountering special characters ^L (form feed character)
  • -f When calculating the number of lines, count the actual number of lines, not the number of lines after automatic line break (some single-line words may be expanded to two lines or more)
  • -p Do not display each page in a scrolling manner, but clear the screen first and then display the content
  • -c Follow -p Similar, but first display the content and then clear other old data
  • -s Replace consecutive blank lines with one blank line
  • -u Do not display the underlined (depending on the terminal specified by the environment variable TERM)
  • +/pattern Search for the specified string (pattern) before each document is displayed, and then start displaying from the string
  • +num Start displaying from the num line
  • fileNames The document to be displayed, can be multiple

Online Examples

Display the document content of testfile page by page. If there are two or more consecutive blank lines, one blank line is displayed.

more -s testfile

From the 20 Start displaying the document content of testfile from the first line.

more +20 testfile

Common Operation Commands

  • Enter Scroll down n lines, needs to be defined. Default is1Line
  • Ctrl+F Scroll down one screen
  • Space key Scroll down one screen
  • Ctrl+B Return to previous screen
  • = Output current line number
  • :f Output file name and current line number
  • V Call vi editor
  • !Command Call Shell and execute command
  • q Exit more

Linux Command大全