The usage of less is more resilient than more. In more, we have no way to turn front, can only look back, but if use less, you can use [PageUp] [PageDown] and other key functions to go to look at the file, more easily used to view the contents of a file! In addition, in less you can have more search function, not only to search down, but also to search upward.
Less common Command parameters
-A ...--search-skip-screen Forward search skips current screen. -b [N] ....--buffers=[n] Number of buffers. -B ...--auto-buffers Don ' t automatically allocate buffers for pipes. -c-c.--clear-screen--clear-screen Repaint by clearing rather than scrolling. -D ...--dumb dumb terminal. -d [XN.N]. --COLOR=XN.N Set screen colors. (MS-DOS only)-e-e ....--quit-at-eof--quit-at-eof quit at end of file. -F ...--force force open non-regular files. -F ...--quit-if-one-screen quit if entire file fits on first screen. -G .....--hilite-search Highlight only the last match for searches. -G ...--hilite-search Don ' t highlight any matches for searches. -h [N] ....--max-back-scroll=[n] Backward scroll limit. I ...--ignore-case Ignore case in searches that does not contain uppercase. -I .....--ignore-case IGNORE case in all searches. -j [N] ....--jump-target=[n] screen position of target lines. -j.--status-column Display A Status column at the left edge of the screen. -K [file]. --lesskey-file=[file] Use a Lesskey file. -L ...--no-lessopen Ignore the lessopen environment variable. -m-m.--long-prompt--long-prompt Set prompt style. -N ...--line-numbers Don ' t use line numbers. -N ...--line-numbers use line NUMBERS. -o [file]. --log-file=[file] Copy to log file (standard input only). -o [file]. --log-file=[file] Copy to LOG FILE (unconditionally overwrite). -p [pattern]--pattern=[pattern] Start at pattern (from command line). -P [Prompt]--prompt=[prompt] DefIne new prompt. -q-q--quiet--quiet--silent--silent quiet The terminal bell. -r-r.--raw-control-chars--raw-control-chars Output "raw" control characters. -S ...--squeeze-blank-lines squeeze multiple blank lines. -S ...--chop-long-lines chop long lines. -T [tag]. --tag=[tag] Find a tag. -T [Tagsfile]--tag-file=[tagsfile] Use an alternate tags file. -u-u.--underline-special--underline-special change handling of backspaces. -V ...--version Display the version number of "less". -W ...--hilite-unread Highlight first new line after Forward-screen. -W ...--hilite-unread Highlight first new line after any forward movement. -X [n[,...]] --tabs=[n[,...]] Set tab stops. -X ...--no-init Don ' t use termcap init/deinit striNgs. --no-keypad Don ' t use termcap keypad init/deinit strings. -y [N] ....--max-forw-scroll=[n] Forward scroll limit. -Z [N] ....--window=[n] Set size of window. -"[C[c]". --QUOTES=[C[C]] Set Shell quote characters. -~.--tilde Don ' t display tildes after end of file. -# [N] ....--shift=[n] Horizontal Scroll amount (0 = one half screen width)
More common Command parameters
Usage:more [-DFLPCSU] [+linenum | +/pattern] name1 name2 ...
Common Command Display
Displays the contents of the file from line 3rd
More +3 /etc/passwd
Finds the first line in the file where the "OMC" string appears, and displays the output from the first two lines at that point
More +/omc/etc/passwd "+/pattern searches for the string before each file is displayed, and then starts from the first two lines of the string to display"
Set the number of rows per screen displayed
More-3/etc/passwd " -n Definition screen size n rows"
List files in one directory, every 4 columns
Ls/root/|more–4
More and less tips for using
Less:-N Displays line numbers
Start a page for the first time
Carriage return indicates a row
A space indicates a single screen
PageUp a row forward
PageDown down.
More
Enter down
Space one screen
PageUp can't go up.
PageDown down.
the difference between more and less
More |
Less |
can only search down |
You can browse files as you wish, either down or up |
Load Full text |
The full text is not loaded before viewing |
can only be down |
Not only can search down, also can search upward. |
Linux less/more Command Detailed