Linux common commands (11)-More

Source: Internet
Author: User

More commands, featuressimilar to Cat,Cat Commandis aThe contents of the entire file are displayed on the screen from top to bottom. Morewill be a page-by-page display to facilitate users to read pages, and the most basic instruction is to press the blank key (space) on the next page, press the B key will be back to a page, but also the function of the search string . The more command reads the file backwards from the front, so it loads the entire file at startup.


1. command format:

More [-DLFPCSU] [-num] [+/pattern] [+ linenum] [file ...]  


2. command function:

The more commands and the cat function are the same view of the contents of the file, but the difference is that more can be viewed by the page to view the contents of the file, but also support the function of direct jump.


3. Command parameters:

+n Display starting from joys N rows

- N Define a screen size of n rows

+/pattern searches for the string (pattern) before each file is displayed, and then from that string first two lines then start showing  

- C Clear the screen from the top and then display

- D Tip "Press space to continue, ' Q ' To quit (press SPACEBAR to continue, pressing Q key to exit)", disable the ringing function

- L Ignore ctrl+l (page break) characters

- P to page a file by clearing the window instead of scrolling, similar to the-C option

- S Display a contiguous number of empty rows as a row

- u Remove the down line from the contents of the file


4. Common operation commands:

Enter down n rows, which need to be defined. Default is 1 rows

ctrl+f Scroll down one screen

Space Bar Scroll down one screen

ctrl+b back to previous screen

=       outputs the line number of the current line

: F output file name and line number of the current line

V Call VI Editor

! Command Call the shell and execute the command

Q Exit more


5. Command instance:

example One. Displays the contents of the file from the third row

Command: More +3 Log22.log


example Two. Finds the first line in the file that appears as the "ABC" string, and displays the output from the first two lines at that point

Command: More +/ABC Log22.log


example Three. Set the number of rows per screen displayed

Command: More-5 log22.log

Press ctrl+f or Space Bar The next screen will display 5 items, and the percentage will change as well.


example Four. List the files in a directory, because there is too much content, we can use more for pagination display, and with the pipeline |

Command: ls-l|more-5






Linux common commands (11)-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.