Page-flipping commands in Linux systems more and less use tutorials

Source: Internet
Author: User

More

more-filter for reading files on the monitor [[]]

Overview (Synopsis)

MORE[-DLFPCSU] [-num] [+/pattern] [+ linenum] [file ...] [[ ]]

Description (DESCRIPTION)

More is a filter that is used for paging (one screen at a time) text. This version is very basic. The user should know that less (1) provides more (1) simulations and is enhanced. [[ ]]

Options (option)

The command line options are described below. Options can be obtained from the environment variable more (to ensure that they begin with a short line ('-)), but command-line options can overwrite them.

-num

This option specifies the number of rows in the screen, expressed as integers.

-D

Let more show the user the message "[press spaces to continue, ' Q ' to quit.]", when the user presses the other key, displays "[News ' H ' for instructions.]" Instead of the speaker Whistle.

-L

More under normal circumstances, ^l (form feed) as a special character, encountered this character will be paused. The-l option can block this feature.

-F

Make more count logical rows, not screen rows (that is, long lines do not break to the next line).

-P

Instead of a volume screen, clear the entire screen, and then display the text.

-C

Instead of a volume screen, the text is displayed from the top of each screen, and the remainder of the line is cleared when the row is displayed.

-S

Compresses the repeated blank lines into a blank line.

-U

Prevents underlining.

+/

Searches for the text string specified by the +/option before displaying each file.

+num

Display from line number Num.

[[ ]]

Commands (command)

More interactive commands are based on VI (1). Some commands start with a decimal number, which is called K in the description below. ^x refers to Control-x.

H or?

Help: Displays a summary of these commands. If you forget all the other commands, please remember this.

MySpace

Displays the next line of K text. The default value is the current screen size.

Z

Displays the next line of K text. The default value is the current screen size. Parameter becomes the new default value.

Return

Displays the next line of K text. The default value is 1. Parameter becomes the new default value.

D or ^d

Volume screen K line. The default value is the current volume screen size, initialized to 11. Parameter becomes the new default value.

Q or Q or INTERRUPT

Exit.

S

Skip the K-line text forward. The default value is 1.

F

Skip the K-screen text forward. The default value is 1.

B or ^b

Skip back to the K-screen text. The default value is 1.

Jumps to where the last search started.

=

Displays the current line number.

/pattern

Searches for a text string that matches the regular expression in K. The default value is 1.

N

Searches for the last K-compliant text string that matches the regular expression. The default value is 1.

! OR:!

Executed in a child shell.

V

Start/usr/bin/vi, pointing to the current line.

^l

Refreshes the screen.

: N

Skip to the following K-file. The default value is 1.

:p

Skip to the previous K file. The default value is 1.

: F

Displays the current file name and line number.

.

Repeat the last command.

[[ ]]

Environment (Environment)

More take advantage of the following environment variables (if they exist):

More

This variable sets the more options you like.

SHELL

The shell that is currently in use (typically the login shell).

TERM

Specifies the terminal type, more used to get the terminal features required for the Operation screen

Cases:

The code is as follows:

[Root@localhost zhangy]# more test.php #查看文件

[Root@localhost zhangy]# netstat-tpnl |more #常用方式, paging display

Less

Less is similar to the more command, but you can view the contents of the page by flipping the button

-b< buffer size > Set buffer size

-e automatically leave when file display is finished

-F forced to open special files, such as peripheral device codes, directories, and binaries

-G only flags the last search keyword

-I ignores capitalization when searching

M displays a percentage similar to the more command

-N Displays the line number of each row

-o< file name > Save the contents of the less output in the specified file

-Q Do not use warning tones

-s shows continuous empty behavior row

-S line too long to discard part

-x< number > Display the TAB key as a specified number space

Command internal operation

The key functions are as follows:

b Turn back one page

D Turn back Half page

H Display Help interface

Q Exit less command

U Roll Forward Half page

Y Scroll one line forward

SPACEBAR to scroll one line

Enter key to scroll one page

1) Forward Search

/: Search using a pattern and navigate to the next matching text

N: Look forward to the next matching text

N: Find the previous matching text backwards

2) Search backwards

? : Use pattern to search, and navigate to the previous matching text

N: Find the next matching text backwards

N: Look forward to the previous matching text

2 Full Screen navigation

CTRL + F: Move one screen forward

CTRL + B: Move one screen back

CTRL + D: Move the half screen forward

CTRL + U: Move back half screen

3 Single-line navigation

J: Move one line forward

K: Move one line backward

4 other navigation

G: Move to the last line

G: Move to the first line

Q/zz: Exit less command

5 Editing files

V: Enter edit mode, edit the current file using the configured editor

6 Tag Navigation

When you use less to view large files, you can mark them in either location, and you can navigate to the text location labeled with a specific tag by command.

MA: Marks the current position of text with a

' A: Navigate to mark A

7 Browsing multiple Files

Mode one, passing multiple parameters to less, you can browse multiple files.

Less file1 file2

Mode two, when you are browsing a file, use: E to open another file.

Less file1

: E file2

When you open multiple files, switch between multiple files using the following command

: N-Browse the next file

:p-Browsing the previous file

Cases:

The code is as follows:

[Root@localhost zhangy]# less test.php #查看文件

[Root@localhost zhangy]# netstat-tpnl |less #常用方式, paging display

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.