0
0
Linux-cliHow-ToBeginner · 3 min read

How to Use More Command in Linux: Simple Guide

Use the more command in Linux to view the contents of a text file one screen at a time. Run more filename to start, then press Space to see the next page or q to quit.
📐

Syntax

The basic syntax of the more command is:

  • more [options] filename

Here, filename is the name of the file you want to view. Options can modify how more behaves, like showing line numbers or starting at a specific line.

bash
more filename.txt
💻

Example

This example shows how to use more to read a file named example.txt. It displays the file content one screen at a time. Press Space to move to the next page and q to exit.

bash
more example.txt
Output
This is line 1 of example.txt This is line 2 of example.txt ... --More--
⚠️

Common Pitfalls

Common mistakes when using more include:

  • Trying to scroll up: more only scrolls forward, not backward.
  • Not quitting properly: Press q to exit, not Ctrl+C.
  • Using more on binary files: It may show unreadable characters.

For backward scrolling, use less instead.

bash
more binaryfile
# Wrong: trying to scroll back
# Right: use less binaryfile
📊

Quick Reference

CommandDescription
more filenameView file content one page at a time
SpaceGo to next page
EnterGo to next line
qQuit the more command
/patternSearch forward for pattern

Key Takeaways

Use more filename to view text files page by page.
Press Space to move forward and q to quit.
more scrolls only forward; use less for backward scrolling.
Avoid using more on binary files to prevent unreadable output.
You can search forward in the file by typing /pattern while viewing.