In Linux, more means "more". It is a content split-screen command that can display the content of a large text file in pages, allowing users to read the content of the file page by page. It is built-in by default. In various Linux distributions, the syntax is "more [options] filename". The execution of the more command will open an interactive interface. Users can use interactive commands to view or edit content. For example, the enter key is used to move down one line, the space bar is used to move down one page, and "d" is used to move down. Half a page.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
linux more command
In Linux, more means "more" and is a content split-screen command.
The more command can display the contents of a large text file in pages, allowing users to read the contents of the file page by page. It is built into every Linux distribution by default.
The basic format of this command is as follows:
more [选项] 文件名
more The command is relatively simple and generally does not require any options. For the options listed in Table 1, users only need to see and recognize them. .
Options | Meaning |
---|---|
-f | When calculating the number of lines, use the actual number of lines, not the number of lines after automatic line wrapping. |
-p | Instead of scrolling through each page, the screen is cleared first and then the content is displayed. |
-c | Similar to the -p option, except that the content is displayed first and other old data is cleared. |
-s | When two or more consecutive blank lines are encountered, they are replaced with one blank line. |
-u | Do not display lower quotes (depending on the terminal specified by the environment variable TERM). |
n | Display the file contents starting from line n, where n represents a number. |
-n | The number of rows displayed at one time, n represents a number. |
more The execution of the command will open an interactive interface, so readers need to understand some interactive commands. Commonly used interactive commands are shown in Table 2.
Interactive command | Function |
---|---|
h or ? | Display interactive command help for the more command. |
q or Q | Exit more. |
v | Start an editor on the current line. |
:f | Display the file name and line number of the current file. |
! |
Execute the specified command in the subshell. |
Enter key | Move down one line. |
space bar | Move down one page. |
Ctrl l | Refresh the screen. |
= | Displays the line number of the current line. |
' | Go to where the last search started. |
Ctrf f | Scroll down one page. |
. | Repeat the last command entered. |
/ String | Search for the specified string. |
d | Move down half a page. |
b | Move up one page. |
more命令的使用
1、简单查看
想检查/var/log目录下的日志文件syslog,只需要键入:
$ more /var/log/syslog
然后我们可以看到在屏幕左下角有个提示,告诉我们当前的显示比例为0%。看上去这个文件相当大,所以第一页是全部页数的0%。使用空格键可以往下翻页,然后就可以看到提示的百分比会增加。
2、限制每页显示的行数
在执行more命令的时候,它会占用你终端窗口的全部空间用于显示。但是你可以通过参数-数字来限制每页显示的行数。
例如,你希望每页限制显示12行,可以通过下面的命令:
$ more -12 /var/log/syslog
现在,你会看到每页只显示12行,在按下空格键后,就会翻页显示后面的12行。
3、显示用户提示
我们知道,more命令会在显示区域的左下角提示当前内容所占的百分比。对于第一次使用more命令的人来说,他或她可能会想知道怎么才能往下翻页。为了避免这种情况,我们可以在执行时增加-d参数,这样就会额外显示一行用户提示“[按空格键继续,‘q‘推出.]
”
如果用户按了‘空格
‘或’q
‘之外的按键,more会显示一行帮助信息“ [按‘h’键查看提示。]
”
如果按下h键,会显示一个帮助信息:
一个有意思的指令是b按钮,b按钮允许你退回到前面的页面。换句话说,b按钮可以允许向前翻页。
你可以通过左上角的...前1页
信息来确认当前显示的是前面的页面。
4、从指定行开始显示
你也可以通过参数+数字来指定开始显示的行,例如,我们有一个15行的文件:
然后我们想从第5行开始显示这个文件的内容,命令看起来会是这个样子:
$ more +5 doc_30.txt
相关推荐:《Linux视频教程》
The above is the detailed content of What does linux more mean?. For more information, please follow other related articles on the PHP Chinese website!

In Linux systems, maintenance mode can be entered by pressing a specific key at startup or using a command such as "sudosystemctlrescue". Maintenance mode allows administrators to perform system maintenance and troubleshooting without interference, such as repairing file systems, resetting passwords, patching security vulnerabilities, etc.

Linux beginners should master basic operations such as file management, user management and network configuration. 1) File management: Use mkdir, touch, ls, rm, mv, and CP commands. 2) User management: Use useradd, passwd, userdel, and usermod commands. 3) Network configuration: Use ifconfig, echo, and ufw commands. These operations are the basis of Linux system management, and mastering them can effectively manage the system.

The article explains how to manage sudo privileges in Linux, including granting, revoking, and best practices for security. Key focus is on editing /etc/sudoers safely and limiting access.Character count: 159

The article provides a guide on setting up two-factor authentication (2FA) for SSH on Linux using Google Authenticator, detailing installation, configuration, and troubleshooting steps. It highlights the security benefits of 2FA, such as enhanced sec

The article discusses using top, htop, and vmstat for monitoring Linux system performance, detailing their unique features and customization options for effective system management.

Article discusses managing software packages in Linux using apt, yum, and dnf, covering installation, updates, and removals. It compares their functionalities and suitability for different distributions.

The article explains how to use regular expressions (regex) in Linux for pattern matching, file searching, and text manipulation, detailing syntax, commands, and tools like grep, sed, and awk.

The article provides a guide on configuring Linux networking, focusing on setting up static IP, DHCP, and DNS configurations. It details steps for editing configuration files and restarting network services to apply changes.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment