Latest web development tutorials

Linux more Command

Linux more Command

Linux command Daquan Linux command Daquan

Linux more command similar to cat, but in the form of one-page display, more user-friendly by-page reading, and basic instruction is to press the space bar (space) started for the next show, press b will go back (back) a show, but also the search string functions (similar to vi), use the instructions in the file, press h.

grammar

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

Parameters:

  • -num a number of rows displayed
  • -d prompts the user, at the bottom of the screen display [Press space to continue, 'q' to quit.], if the user pressed the wrong button, it will display [Press 'h' for instructions.] instead of 'beep' sound
  • Pause function -l canceled meet special character ^ L (feed characters) when
  • -f When calculating the number of rows to the actual number of rows, rather than the number of lines after the automatic line feed (some long single line of words will be extended to more than two lines or two lines)
  • -p not to scrolling display on each page, but to clear the screen and display
  • -c -p with similar, except that the first display and then clear the other old data
  • -s When there is a blank line encountered more than two consecutive lines, one line will be replaced by a blank line
  • -u does not display quotes (TERM environment variable according to the specified terminal vary)
  • + / Pattern to search for the string (pattern) is displayed in front of each document, and then began to show after the string from
  • + Num num began to show from the first row
  • fileNames To display the contents of documents, may be plural number

Examples

Testfile document content display page by page, if more than two consecutive blank lines places a line blank lines.

more -s testfile

Line 20 from the beginning of the document to display the contents of testfile.

more +20 testfile

Common Operations Command

  • Enter n down the line, we need to define. The default is 1 line
  • Ctrl + F to scroll down a screen
  • Spacebar to scroll down a screen
  • Ctrl + B to return to the previous screen
  • = Output current line number
  • : F the current output file name and line number
  • V invokes the vi editor
  • ! Command invoke Shell, and execute the command
  • q quit more

Linux command Daquan Linux command Daquan