search
What does linux more mean?Jun 17, 2022 pm 04:57 PM
linux

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.

What does linux more mean?

#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. .

Table 1 more command options and meaning
          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.

Table 2 more command interaction instructions and functions
            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.
          ! or :!           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

What does linux more mean?

然后我们可以看到在屏幕左下角有个提示,告诉我们当前的显示比例为0%。看上去这个文件相当大,所以第一页是全部页数的0%。使用空格键可以往下翻页,然后就可以看到提示的百分比会增加。

What does linux more mean?

2、限制每页显示的行数

在执行more命令的时候,它会占用你终端窗口的全部空间用于显示。但是你可以通过参数-数字来限制每页显示的行数。

例如,你希望每页限制显示12行,可以通过下面的命令:

$ more -12 /var/log/syslog

What does linux more mean?

现在,你会看到每页只显示12行,在按下空格键后,就会翻页显示后面的12行。

3、显示用户提示

我们知道,more命令会在显示区域的左下角提示当前内容所占的百分比。对于第一次使用more命令的人来说,他或她可能会想知道怎么才能往下翻页。为了避免这种情况,我们可以在执行时增加-d参数,这样就会额外显示一行用户提示“[按空格键继续,‘q‘推出.]

What does linux more mean?

如果用户按了‘空格‘或’q‘之外的按键,more会显示一行帮助信息“ [按‘h’键查看提示。]

What does linux more mean?

如果按下h键,会显示一个帮助信息:

What does linux more mean?

一个有意思的指令是b按钮,b按钮允许你退回到前面的页面。换句话说,b按钮可以允许向前翻页。

你可以通过左上角的...前1页信息来确认当前显示的是前面的页面。

What does linux more mean?

4、从指定行开始显示

你也可以通过参数+数字来指定开始显示的行,例如,我们有一个15行的文件:

What does linux more mean?

然后我们想从第5行开始显示这个文件的内容,命令看起来会是这个样子:

$ more +5 doc_30.txt

What does linux more mean?

相关推荐:《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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
什么是linux设备节点什么是linux设备节点Apr 18, 2022 pm 08:10 PM

linux设备节点是应用程序和设备驱动程序沟通的一个桥梁;设备节点被创建在“/dev”,是连接内核与用户层的枢纽,相当于硬盘的inode一样的东西,记录了硬件设备的位置和信息。设备节点使用户可以与内核进行硬件的沟通,读写设备以及其他的操作。

Linux中open和fopen的区别有哪些Linux中open和fopen的区别有哪些Apr 29, 2022 pm 06:57 PM

区别:1、open是UNIX系统调用函数,而fopen是ANSIC标准中的C语言库函数;2、open的移植性没fopen好;3、fopen只能操纵普通正规文件,而open可以操作普通文件、网络套接字等;4、open无缓冲,fopen有缓冲。

linux中什么叫端口映射linux中什么叫端口映射May 09, 2022 pm 01:49 PM

端口映射又称端口转发,是指将外部主机的IP地址的端口映射到Intranet中的一台计算机,当用户访问外网IP的这个端口时,服务器自动将请求映射到对应局域网内部的机器上;可以通过使用动态或固定的公共网络IP路由ADSL宽带路由器来实现。

linux中eof是什么linux中eof是什么May 07, 2022 pm 04:26 PM

在linux中,eof是自定义终止符,是“END Of File”的缩写;因为是自定义的终止符,所以eof就不是固定的,可以随意的设置别名,linux中按“ctrl+d”就代表eof,eof一般会配合cat命令用于多行文本输出,指文件末尾。

linux怎么判断pcre是否安装linux怎么判断pcre是否安装May 09, 2022 pm 04:14 PM

在linux中,可以利用“rpm -qa pcre”命令判断pcre是否安装;rpm命令专门用于管理各项套件,使用该命令后,若结果中出现pcre的版本信息,则表示pcre已经安装,若没有出现版本信息,则表示没有安装pcre。

什么是linux交叉编译什么是linux交叉编译Apr 29, 2022 pm 06:47 PM

在linux中,交叉编译是指在一个平台上生成另一个平台上的可执行代码,即编译源代码的平台和执行源代码编译后程序的平台是两个不同的平台。使用交叉编译的原因:1、目标系统没有能力在其上进行本地编译;2、有能力进行源代码编译的平台与目标平台不同。

linux怎么查询mac地址linux怎么查询mac地址Apr 24, 2022 pm 08:01 PM

linux查询mac地址的方法:1、打开系统,在桌面中点击鼠标右键,选择“打开终端”;2、在终端中,执行“ifconfig”命令,查看输出结果,在输出信息第四行中紧跟“ether”单词后的字符串就是mac地址。

linux中rpc是什么意思linux中rpc是什么意思May 07, 2022 pm 04:48 PM

在linux中,rpc是远程过程调用的意思,是Reomote Procedure Call的缩写,特指一种隐藏了过程调用时实际通信细节的IPC方法;linux中通过RPC可以充分利用非共享内存的多处理器环境,提高系统资源的利用率。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

mPDF

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),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.