Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the more command on Linux system

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article analyzes "how to use the more command on Linux system". The content is detailed and easy to understand. Friends who are interested in "how to use more commands in the Linux system" can follow the editor's train of thought to read it slowly and deeply. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "how to use more commands in Linux system".

More is a command used to view the content of text in Linux systems, and it is more powerful than the cat command.

1. Linux more command syntax

The syntax format of the more command is as follows:

More [- dlfpcsu] [- num] [+ / pattern] [+ linenum] [file...] Parameters:

The common parameters of the Linux more command are as follows:

-the number of rows displayed by num at one time-d prompts the user to display [Press space to continue,'q' to quit.] at the bottom of the screen. If the user presses the wrong key, it will display [Press 'h' for instructions.] Instead of beeping-l cancels the function that is paused when encountering a special character ^ L (feed characters)-f counts the number of lines based on the actual number of lines, rather than the number of lines after line wrapping (some single-line words that are too long will be expanded to two or more lines)-p does not scroll each page, but clear the screen before displaying the content-c is similar to-p The difference is that the content is displayed first and then other old data is cleared-s is replaced with a blank line when there are more than two consecutive blank lines-u does not display lower quotation marks (depending on the terminal specified by the environment variable TERM) + / pattern searches for the string (pattern) before each document is displayed Then display + num after the string 2. Linux more command example 1) display the contents of the file1 document page by page, if there are consecutive blank lines, it will be displayed on a blank line

# more-s file1 This is a test file. Welcome to linuxdaxue.com! This is cat command test.2) displays the contents of the file1 document from the second line

# more + 2 file1 Welcome to linuxdaxue.com! This is cat command test.3) sets the number of rows displayed per screen

# more-2 file1 This is a test file. Welcome to linuxdaxue.com!-- More-- (64%) 4) use the pipe character "|" with other commands

# ls | more-2 file1 file2-- More-- 3. Common operations of Linux more commands. Here are some common operation commands for more commands:

Enter goes down n lines and needs to be defined. The default is 1 line Ctrl+F scroll down one screen space bar (space) scroll down one screen Ctrl+B to return to the previous screen = output the current line number: F output the file name and the current line number V call the vi editor! Command call Shell, and execute the command Q exit more about how to use the Linux system more command to share here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report