More pagination Display text command English intent
Command format
more [-dlfpcsu ][-num ] [+/ pattern][+ linenum] [file ... ]
Command function
- The more command, which functions like cat, the Cat command is the entire contents of the 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.
Common parameters
+nDisplay starting from joys N rows
-nDefine a screen size of n rows
+/patternSearch for the string (pattern) before each file is displayed, and then start the display after the first two lines of the string
-cClear the screen from the top and then display
-dTip "Press space to continue, ' Q ' to quit (pressing SPACEBAR to continue,
? Press the Q key to exit), disable the ringing function
-lIgnore Ctrl+l (page break) characters
-pTo page a file by clearing the window instead of scrolling, similar to the-C option
-sDisplay a contiguous number of empty rows as a row
-uRemove the down line from the contents of the file
Common Operations Commands
EnterDown n rows, which need to be defined. Default is 1 rows
Ctrl+FScroll down one screen
空格键Scroll down one screen
Ctrl+BBack to previous screen
=Outputs the line number of the current line
:fOutput file name and line number of the current line
VCall VI Editor
!命令Call the shell and execute the command
qExit more
Common Example Example 1
Displays the contents of the file from line 3rd
[[email protected] test]# cat log2012.log 2012-012012-022012-032012-04-day12012-04-day22012-04-day3======[[email protected] test]# more +3 log2012.log 2012-032012-04-day12012-04-day22012-04-day3======[[email protected] test]#
Example 2
Finds the first line in the file where the "Day3" string appears, and displays the output from the first two lines at that point
[[email protected] test]# more +/day3 log2012.log ...skipping2012-04-day12012-04-day22012-04-day32012-052012-05-day1======[[email protected] test]#
The bottom shows that the screen shows the proportion of the total number of files, press CTRL+F or SPACEBAR will display the next screen 5 content, the percentage will also change.
Example 3
Set the number of rows per screen displayed
[[email protected] test]# more -5 log2012.log 2012-012012-022012-032012-04-day12012-04-day2
Example 4
List the files in a directory, because there is too much content, we should learn to use more to page display. This has to do with plumbing | Combined.
[[email protected] test]# ls -l | more -5总计 36-rw-r--r-- 1 root root 308 11-01 16:49 log2012.log-rw-r--r-- 1 root root 33 10-28 16:54 log2013.log-rw-r--r-- 1 root root 127 10-28 16:51 log2014.loglrwxrwxrwx 1 root root 7 10-28 15:18 log_link.log -> log.log-rw-r--r-- 1 root root 25 10-28 17:02 log.log-rw-r--r-- 1 root root 37 10-28 17:07 log.txtdrwxr-xr-x 6 root root 4096 10-27 01:58 scfdrwxrwxrwx 2 root root 4096 10-28 14:47 test3drwxrwxrwx 2 root root 4096 10-28 14:47 test4
Linux File Management more