Table of Contents
linux more command
more命令的使用

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 [选项] 文件名
Copy after login

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
Copy after login

What does linux more mean?

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

What does linux more mean?

2、限制每页显示的行数

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

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

$ more -12 /var/log/syslog
Copy after login

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
Copy after login

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 of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

What is vscode What is vscode for? What is vscode What is vscode for? Apr 15, 2025 pm 06:45 PM

VS Code is the full name Visual Studio Code, which is a free and open source cross-platform code editor and development environment developed by Microsoft. It supports a wide range of programming languages ​​and provides syntax highlighting, code automatic completion, code snippets and smart prompts to improve development efficiency. Through a rich extension ecosystem, users can add extensions to specific needs and languages, such as debuggers, code formatting tools, and Git integrations. VS Code also includes an intuitive debugger that helps quickly find and resolve bugs in your code.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

See all articles