How to use the Linux more command in Linux common commands

How to use the Linux more command in Linux common commands

more is one of our most commonly used tools. The most common use is to display the output content, and then display it in pages according to the size of the window, and then it can also prompt the percentage of the file.

The function of more is similar to cat. The cat command displays the contents of the entire file from top to bottom on the screen. More will display the pages one by one for the convenience of users to read page by page. The most basic instruction is to press the space key to display the next page, and press the b key to display the back page. There is also a search string function. The more command reads the file from front to back, so the entire file is loaded at startup.

1. Command format:

more [-dlfpcsu ] [-num ] [+/ pattern] [+ linenum] [file ... ]

2. Function:

The more command has the same function as cat, which is to view the contents of a file. However, the difference is that more can view the contents of a file by page and also supports functions such as direct line jump.

3. Command parameters:

linuxidc@linuxidc:~/桌面/Linux公社$ more --help

usage:

more [選項] <文件>...

A file reading and output tool suitable for screen viewing.

Options:

-d Display help instead of beeping
-f counts logical lines, not screen lines
-l suppresses pause after form feed
-c Do not scroll, display text and clean up the end of the line
-p Clear the screen and display text without scrolling
-s compress multiple blank lines into one line
-u shield underline
-<number> Number of lines per screen
+<number> Display the file starting from the specified line
+/<string> Display files starting from the position matching the search string
--help display this help
-V, --version display version

For more information, see more(1).

linuxidc@linuxidc:~/桌面/Linux公社$

Examples

Display the linuxidc document content page by page. If there are more than two consecutive blank lines, they will be displayed as one blank line.

more -s linuxidc

The document content of linuxidc is displayed starting from line 20.

more +20 linuxidc

Common operation commands

Enter Go down n lines, need to be defined. The default is 1 line
Ctrl+F Scroll down one screen Spacebar Scroll down one screen
Ctrl+B Return to the previous screen
= Output the line number of the current line: f Output the file name and the line number of the current line
V calls the vi editor
!Command calls Shell and executes the command
q exitmore

Summarize

The above is the usage of the Linux more command among the commonly used Linux commands introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Learn a Linux command every day: more command
  • linux cat more less display file differences

<<:  Solve the problem that Mysql5.7.17 fails to install and start under Windows

>>:  js dynamically adds example code for a list of circled numbers

Recommend

Let's talk in detail about the difference between unknown and any in TypeScript

Table of contents Preface 1. unknown vs any 2. Th...

JavaScript static scope and dynamic scope explained with examples

Table of contents Preface Static scope vs. dynami...

Simple example of limit parameter of mysql paging

Two parameters of Mysql paging select * from user...

mysql solves the problem of finding records where two or more fields are NULL

Core code /*-------------------------------- Find...

Use personalized search engines to find the personalized information you need

Many people now live on the Internet, and searchin...

How to create a my.ini file in the MySQL 5.7.19 installation directory

In the previous article, I introduced the detaile...

Solution to the problem of English letters not wrapping in Firefox

The layout of text has some formatting requiremen...

How to use nginx to access local static resources on Linux server

1. Check whether port 80 is occupied. Generally, ...

7 ways to vertically center elements with CSS

【1】Know the width and height of the centered elem...

Learn more about using regular expressions in JavaScript

Table of contents 1. What is a regular expression...

How to configure redis sentinel mode in Docker (on multiple servers)

Table of contents Preface condition Install Docke...

Add a floating prompt for the header icon in the ElementUI table

This article mainly introduces how to add floatin...

Detailed explanation of Vue router routing guard

Table of contents 1. Global beforeEach 1. Global ...

win10 mysql 5.6.35 winx64 free installation version configuration tutorial

mysql 5.6.35 winx64 free installation version con...