A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/linux-unix/more-command-in-linux-with-examples/ below:

more command in Linux with Examples

more command in Linux with Examples

Last Updated : 11 Jul, 2025

The 'more' command in Linux is a useful tool for viewing text files in the command prompt, particularly when dealing with large files like log files. It displays the content one screen at a time, allowing users to scroll through the text easily. This command is especially handy for reviewing long outputs and can be combined with other commands using pipes.

Here, we’ll explore the various functionalities of the more command, including its syntax, options, and practical examples.

What is the 'more' Command?

The 'more' command is a basic pager program used in Unix-like systems to view text files in the command line interface. It provides a convenient way to navigate through files one screenful at a time, making it ideal for reading lengthy files without overwhelming the terminal with all the content at once.

Syntax:
more [-options] [-num] [+/pattern] [+linenum] [file_name]

where,

Navigating Through Text Files Using the 'more' Command

While viewing text files with 'more', you can use the following controls for navigation:

Common Options for the more Command 1. '-d' (Prompt Navigation Help)

Use this command in order to help the user to navigate.

Example:

more -d sample.txt
2. '-f' (Disable Line Wrapping)

Displays long lines without wrapping them, showing them as they are in the file. This option is useful when the exact formatting of text is important.

Example:

more -f sample.txt
3. '-p' (Clear and Display)

Clears the screen before displaying the next page, making the reading experience cleaner by removing previously shown content.

Example:

more -p sample.txt
4. '-c' (Overlapping Text)

Overlaps the new text over the old text on the same screen space, providing a continuous reading flow without clearing the screen.

Example:

more -c sample.txt
5. '-s' (Squeeze Blank Lines)

Compresses multiple blank lines into a single blank line, making large documents more concise and easier to read.

Example:

more -s sample.txt
6. '-u' (Omit Underlines)

Removes underlined characters, which can be useful when viewing text files with special formatting that is not needed for content comprehension.

Example:

more -u sample.txt
7. '+/pattern' (Search Pattern)

This option is used to search the string inside your text document. You can view all the instances by navigating through the result.

Example:

more +/reset sample.txt
8. '+num' (Start at Line Number)

Displays the content starting from the specified line number, useful when you want to skip over the beginning of a file

Example:

more +30 sample.txt
Using 'more' to Read Long Outputs

We use more command after a pipe to see long outputs. For example, seeing log files, etc.

cat a.txt | more
Conclusion

The 'more' command in Linux is a simple yet powerful tool that significantly enhances the user experience when viewing and navigating through large text files. With its various options and seamless integration with other commands, mastering the 'more' command can greatly improve your efficiency in managing text files within the command line environment.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4