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

Blog    

Recommend

Vue data two-way binding implementation method

Table of contents 1. Introduction 2. Code Impleme...

Summary of five commands to check swap space in Linux

Preface Two types of swap space can be created un...

Implementing login page based on layui

This article example shares the specific code of ...

Share a Markdown editor based on Ace

I think editors are divided into two categories, ...

Example of using rem to replace px in vue project

Table of contents tool Install the plugin Add a ....

HTML Form Tag Tutorial (4):

Suppose now you want to add an item like this to ...

Vue uses mockjs to generate simulated data case details

Table of contents Install mockjs in your project ...

How to Dockerize a Python Django Application

Docker is an open source project that provides an...

Implementation of tomcat image created with dockerfile based on alpine

1. Download the alpine image [root@docker43 ~]# d...

Example of using Dockerfile to build an nginx image

Introduction to Dockerfile Docker can automatical...

mysql-8.0.17-winx64 deployment method

1. Download mysql-8.0.17-winx64 from the official...

MySQL log trigger implementation code

SQL statement DROP TRIGGER IF EXISTS sys_menu_edi...

Implementation of Element-ui Layout (Row and Col components)

Table of contents Basic instructions and usage An...