More commands in CentOS

Source: Internet
Author: User
More: The more command is similar to cat. the cat command displays the content of the entire file on the screen from top to bottom. More will display one page at a time to facilitate users to read one page at a time. the most basic instruction is to press the space key to display it on the next page, and press the B key to return (back) one page is displayed, and the string search function is also available. The more command reads the file from the front and back, so the entire file is loaded at startup. [Content display command too] command parameter: + n from limit n line More

Function description:The more command is similar to cat. the cat command displays the content of the entire file on the screen from top to bottom. More will display one page at a time to facilitate users to read one page at a time. the most basic instruction is to press the space key to display it on the next page, and press the B key to return (back) one page is displayed, and the string search function is also available. The more command reads the file from the front and back, so the entire file is loaded at startup.

[Content display command too]

Command parameters:

+ N is displayed from rows n of bytes.

-N defines the screen size as n rows

+/Pattern search for the string (pattern) before each file is displayed, and then the string is displayed after the first two lines.

-C clear the screen from the top and then display

-D: Press space tocontinue, 'Q' to quit (Press the space key to continue and Press the q key to exit). disable the ring function.

-L ignore Ctrl + l (page feed) characters

-P clears the window instead of scrolling the screen to change the page of the file, similar to the-c option.

-S: displays multiple consecutive empty rows as one row.

-U remove the offline lines in the file content

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.

Instance used:


(1) search for a string in the file and display it from the first two rows of the next row.

[Atong @ LiWenTong ~] $ Cat 1.log

Testatong

Atong

[Atong @ LiWenTong ~] $ More +/atong 1.lo

Testatong

Atong


(2) when stdout is too long, multiple screens are displayed through pipelines

[Atong @ LiWenTong ~] $ Ls-l/| more

Total 162

Drwxr-xr-x 2 root 4096 Apr 25 bin

Drwxr-xr-x 4 root 1024 Apr 25 04: 11 boot

Drwxr-xr-x 9 root 3820 May 4 dev

Drwxr-xr-x 84 root 4096 May 5 etc

/Var/lock/subsys/lvm2-monitor.

47 ---- if press =, the current row number is displayed. + Press the number first and then enter to flip the line down.


-------------------------- Subsequent self-summary ---------------

More is the content display command, and the main function is to display the content. When you want it to be displayed, you must have different simple operation parameters, such: you can search and then display more +/atong 1.log to view the current number of rows displayed by =. In addition, Press + 10enter as to the number of pages to be flipped down. To quickly flip pages. Basically, these operations are often familiar with the process of using them several times.


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.