Home  >  Article  >  System Tutorial  >  How to use the common Linux command more

How to use the common Linux command more

下次还敢
下次还敢Original
2024-04-11 17:30:19636browse

Linux more command is used to display the file content page by page. Common parameters include: -d: display page number and percentage -e: automatic scrolling -f: continuous display -p: start displaying from the specified line number -s: How to use to compress empty lines: more [parameter] [file name] Press the space bar to turn pages, b key to go back and enter d to display the page number, enter e to automatically scroll, enter f to display continuously, use -p to start displaying from a specific line number

How to use the common Linux command more

Linux more command

Purpose:
View the file content and display it page by page.

Syntax:

<code>more [参数] [文件名]</code>

Common parameters:

  • -d: Display page number of rows and percentage.
  • -e: Automatic scrolling without user interaction.
  • -f: Display files continuously without pressing the space bar to turn pages.
  • -p: Display the file starting from the specified line number.
  • -s: Compress consecutive blank lines.

Usage:

  • View file: more File name
  • Page by page: Use the space bar to page down and the b key to page up.
  • Display page number: Enter d.
  • Auto scroll: Enter e.
  • Continuous display: Enter f.
  • Start displaying from a specific line number: Use the -p parameter, such as more -p 100 file name Start displaying from line 100.

Example:

  • View the /etc/passwd file and display the page number:

    <code>more -d /etc/passwd</code>
  • View in auto-scroll mode/var/log/messagesFile:

    <code>more -e /var/log/messages</code>
  • Start viewing at line 50/ home/user/myfile.txtFile:

    <code>more -p 50 /home/user/myfile.txt</code>

The above is the detailed content of How to use the common Linux command more. 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