Linux Command Learning Note: more commands

Source: Internet
Author: User

More commands, similar functionsCat, the Cat command is the contents of the entire file displayed on the screen from top to bottom. More will 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 command and the cat function is to view 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 functions such as direct jump. 3. Command parameters:+n displays starting from joys N rows-n defines the screen size as n rows+/pattern searches for the string (pattern) before each file is displayed, and then starts from the first two lines of the string-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 pages are changed by clearing the window instead of scrolling, and-c option is similar-s displays a contiguous number of empty rows as a row-u remove the lower line from the contents of the file4. Common Operations Command: Enter down n lines, need to be defined. The default is 1 lines Ctrl+F Scroll down one screen SPACEBAR to scroll down one screen Ctrl+B Return to previous screen=output The line number of the current line: F output file name and line number of the current line v Call VI editor!command calls the shell and executes the command Q exit more5. Command instance: Instance 1: Displays the content command from line 3rd in the file: More+3log2012.log output: [[email protected] test]#CatLog2012.log -- on -- Geneva --Geneva --Geneva-Day1 --Geneva-Day2 --Geneva-Day3======[[email protected] test]# More+3Log2012.log --Geneva --Geneva-Day1 --Geneva-Day2 --Geneva-Day3======[[email protected] test]# Instance 2: Find the first occurrence from a file"Day3"string, and the output command is displayed starting at the first two lines of the line: More+/day3 log2012.log output: [[email protected] test]# More+/day3 Log2012.log ... skipping --Geneva-Day1 --Geneva-Day2 --Geneva-Day3 -- to -- to-Day1======[[email protected] test] #实例3: Set the number of rows per screen command: More-5log2012.log output: [[email protected] test]# More-5Log2012.log -- on -- Geneva --Geneva --Geneva-Day1 --Geneva-day2 Description: As shown, the bottom of the screen shows the proportion of the total number of file rows, press Ctrl+F or SPACEBAR will display the next screen 5 content, the percentage will also change. Example 4: Column A directory of files, because the content is too much, we should learn to use more to page display. It's got to be with the plumbing|Combine commands:ls-L | More-5output: [[email protected] test]#ls-L | More-5Total $-rw-r--r--1Root root308  One- on  -: theLog2012.log-rw-r--r--1Root root - Ten- -  -: WuLog2013.log-rw-r--r--1Root root127 Ten- -  -:Wuyilog2014.loglrwxrwxrwx1Root root7 Ten- -  the: -Log_link.logLog.log-rw-r--r--1Root root - Ten- -  -: GenevaLog.log-rw-r--r--1Root rootPanax Notoginseng Ten- -  -: -LOG.TXTDRWXR-xr-x6Root root4096 Ten- -  on: -scfdrwxrwxrwx2Root root4096 Ten- -  -: -test3drwxrwxrwx2Root root4096 Ten- -  -: -test4 Description: Display 5 file information per page, press CtrlThe +F or SPACEBAR will display the next 5 file information.

Linux Command Learning Note: more commands

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.