more command in Linux and it perimeters

more command in Linux and it perimeters

The more command in Linux is used to view the contents of a text file one screenful at a time. It allows you to scroll through the file interactively, viewing the file page by page. Unlike less, more does not support backward scrolling or advanced features, making it a simple and straightforward pager for text files.

The basic syntax of the more command is:

Bash
more [options] file

Where:

  • file is the name of the text file you want to view using more.

Here is a table of the more command’s parameters:

ParameterDescription
-bBypass the built-in binary file detection.
-cContinuously scroll the output.
-dDisplay the file name at the bottom of the screen.
-fForce more to treat the input as a text file.
-HDisplay the help message.
-iIgnore case when searching.
-nNumber the lines.
-sSqueeze multiple blank lines into a single blank line.
-SSkip lines that match a regular expression.

Examples:

  • Display the file file.txt one screen at a time:
Bash
more file.txt
  • Continuously scroll the output of the file file.txt:
Bash
more -c file.txt
  • Display the file name at the bottom of the screen for the file file.txt:
Bash
more -d file.txt
  • Ignore case when searching the file file.txt:
Bash
more -i file.txt
  • Number the lines of the file file.txt:
Bash
more -n file.txt
  • Squeeze multiple blank lines into a single blank line in the file file.txt:
Bash
more -s file.txt
  • Skip lines that match the regular expression ^.*foo.*$ in the file file.txt:
Bash
more -S '^.*foo.*$' file.txt

The more command is a powerful tool that can be used to view text files. By understanding the different parameters that the more command can take, you can use it to view text files effectively.

Total
0
Shares

Leave a Reply

Previous Post
lpr command in Linux and it perimeters

lpr command in Linux and it perimeters

Next Post
nl command in Linux and it perimeters

nl command in Linux and it perimeters

Related Posts