more
The more
command in Linux is a command-line utility used for displaying text files and command outputs page by page in a terminal. It's one of the older utilities for this purpose, with functionality similar to less
, albeit with some limitations. Here's an overview of the more
command and its features:
Basic Functionality: To view a file in a paginated manner, you use
more filename
. This opens the file and displays its content one screen at a time.Navigation: Inside
more
, the primary way to navigate is by pressing theSpacebar
to move forward one screen of content. You can also use theEnter
key to advance line by line. However, unlikeless
,more
does not support backward scrolling in the file.Viewing Command Output:
more
is often used to view the output of other commands in a paginated way. For example,ls -l | more
would list the contents of a directory page by page.Search Functionality: You can perform a simple search within the displayed content in
more
by typing/
followed by the search term and pressing Enter. However, its search capabilities are not as advanced as inless
.Exit
more
: To exit frommore
, you pressq
.Limitations Compared to
less
:No Backward Navigation: Unlike
less
,more
does not allow you to scroll backwards. It only supports forward navigation.Limited Search and Navigation Options:
more
has fewer options for searching and navigating compared toless
.
Historical Context:
more
predatesless
and was one of the first tools to provide a paginated viewing experience for text files and command output.less
was later developed to include more features and capabilities, including backward navigation and a broader set of commands.Common Usage: Despite its limitations,
more
is still commonly used for quick viewing of files where backward navigation is not needed, particularly in scripts or systems whereless
might not be available.
Last updated