One linux Command every day (12): more command

Source: Internet
Author: User
Tags call shell touch command


One linux Command every day (12): more command link: One linux Command every day (1): ls command http://www.bkjia.com/ OS /201210/163049.html#linuxlinuxcommand every day (2): cd command serial (3 ): pwd command Export (4): mkdir command http://www.bkjia.com/ OS /201210/1620.3.html#a linuxcommand every day (5): rm command Export (6): rmdir command http://www.bkjia.com/ OS /201210/164017. Html; one linux Command every day (7): mv command running (8): cp command http://www.bkjia.com/ OS /201210/163164.html#a linuxcommand every day (9): touch command running (10): cat command running (11 ): nl command http://www.bkjia.com/ OS /201211/165990.html more command, similar to cat, cat command is the content of the entire file is displayed 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. Www.2cto.com 1. command syntax: more [-dlfpcsu] [-num] [+/pattern] [+ linenum] [file...] 2. command function: the more command and cat command are used to view the content in the file, but the difference is that more can view the content of the file by PAGE, and supports direct line navigation and other functions. 3. command Parameter: + n is displayed from rows minus n.-n is defined as n rows. +/pattern: search for the string (pattern) before each file is displayed ), then, from the first two lines of the string, the-c is displayed on the top of the screen, and the-d prompt is displayed, "Press space to continue, 'q' to quit (Press the space key to continue, press the q key to exit) ", disable the bell function-l ignore the Ctrl + l (for page feed) character-p by clearing the window rather than scrolling the screen to swap the file, similar to the-c option,-s displays multiple consecutive blank lines as one line.-u removes the offline lines in the file content. 4. common Operation Command: Enter n rows down, which needs to be defined. The default value is 1 line Ctrl + F scroll down one screen space key scroll down one screen Ctrl + B Return the previous screen = output the row number of the current line: f. The output file name and the row number V call the vi editor! Run the command to call Shell and run the command q to exit more5. command instance: instance 1: display the content of the file starting from line 3rd. Command: more + 3 log2012.log output: [root @ localhost test] # cat log2012.log logs ===== [root @ localhost test] # more + 3 log2012.log 2012-032012-04-day12012-04-day22012-04-day3 ==== [root @ localhost test] # instance 2: find the first line with the "day3" string in the file, and display the output command: more +/day3 log2012.log output from the first two lines: [root @ localhost test] # more +/day3 log2 012. log... skipping2012-04-day12012-04-day22012-04-day32012-052012-05-day1 ====== [root @ localhost test] # instance 3: set the number of lines per screen command: more-5 log2012.log output: [root @ localhost test] # more-5 log2012.log 2012-012012-022012-032012-04-day12012-04-day2 Note: As shown in, the following shows the proportion of the content displayed on the screen to the total number of lines of the file, press Ctrl + F or the space key to display 5 entries on the next screen. The percentage also changes. Example 4: List files in a directory. Because there are too many contents, we should learn to use more for paging display. This must be combined with the pipeline | command: ls-l | more-5 output: [root @ localhost test] # ls-l | more-5 total 36-rw-r -- r -- 1 root 308 11-01 16:49 log2012.log-rw-r -- 1 root 33 10 -28 log2013.log-rw-r -- 1 root 127 10-28 log2014.loglrwxrwxrwx 1 root 7 10-28 log_link.log-> log. log-rw-r -- 1 root 25 10-28 17:02 log. log-rw-r -- 1 root 37 10-28 :07 log.txt drwxr-xr-x 6 root 40 96 10-27 scfdrwxrwxrwx 2 root 4096 10-28 test3drwxrwxrwx 2 root 4096 10-28 test4 Description: five files are displayed on each page, press Ctrl + F or the space key to display the next five files.

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.