The more command in Linux

Utility more designed for the paging file in Linux terminal. It owes its name to the inscriptions more (in the Russian version — on) appearing at the bottom of each page.

The more linux is one of the most primitive commands for working with text. Its nearest relative is the less — has a much greater range of options and additional features. Let us look at its syntax and examples of usage.

  • The syntax and options of more
  • Examples of usage more
  • Insights

The syntax and options of more

Emulator Linux terminal command is written like this:

$ more file

List the command options:

  • -d — display information at the end of the page buttons are used to continue the work, completing it or receiving instructions;
  • -l — ignoring the text character of the page break;
  • -f — counting the number of logical lines instead of the function;
  • -p — clear terminal screen in order for the user to use the scroll before displaying the next portion of text;
  • -c — eliminate the need for scrolling (like -p) — display the text starting from the top of the screen and erasing the previous output line by line;
  • -s — replace multiple empty lines in a row, one blank line;
  • -u — remove underscore;
  • -n — displays n-th number of rows.
  • +n — display the text starting at line number n;
  • +/string — search the file for the specified string and the beginning of the text output from it;
  • –help — displays help;
  • -v (–version) — display the current version of the utility.

Also, the more command has its own hotkey, and interactive commands:

  • h (?) — help (display information only about the interactive commands);
  • SPACE — display the next chunk of text (the default number of rows depends on the current size of the terminal window);
  • z — same as SPACE;
  • ENTER — text output line by line (step commands — one line);
  • d (^D) — scrolling in number of lines corresponding to the size of the terminal;
  • q (Q) — exit from the utility;
  • s — move forwards one line;
  • f — move one screen page forward;
  • b (^B) — go one screen page backward;
  • — a return to the starting point of the search;
  • = displays the current number of rows;
  • /pattern — search using regular expressions;
  • n — search for words and phrases corresponding to the last used regular expression;
  • !command (:command) — execute the commands in subblock;
  • v — open the file in a text editor is the default, and if none found, use a console text editor to open the file;
  • ^L — removal from the screen of everything except the contents of the file;
  • :n — go to the next file.
  • :p — go to previous file;
  • :f — output the name of the current file and number of lines in it;
  • . – re-run the previous command.

Examples of usage more

In order to view the text from a file, use the command:

more example-file-for-more-command.txt

Also you can list several file names one after the other, separated by a space. The contents of these files will be displayed in the same order. Example:

more abc1.txt dfg2.txt

If the file is not in the current directory, specify its full address.

Sometimes it is necessary to display all text, but only part of it. For such cases, provided options (minus) and + (plus), a number which indicates the number of rows. For example, to see the contents of the file, starting from the 8th line should be added to the command option +8, and that command outputs the result, consisting of a maximum of 5 lines, option -5:

more +8 -5 example-file-for-more-command.txt

By default, the command more Linux considers a string that is the display string is the number of characters that can be placed in one row across the width of the window. To run the accounts in a logical lines (when typing text separated by pressing Enter), use the-f option. Example:

more-f +8 -5 example-file-for-more-command.txt

However, more able to work not only with text files — it is possible to redirect the output of other commands (pipelining). The first is to be the main team, the second — more with the required options. Team necessarily separated by vertical bars. Example:

locate bin | -10 more

When the team brought the text and waiting for further action the user can perform interactive commands. They need to control the output.

For example, in order to know the current line number, press =, and to view the file in a text editor, press v.

It should be noted that not all interactive commands can be executed if the utility redirected the output to another command. Open a text editor and go one page back (b or ^B) works only when viewing text files.

In order to obtain a list of all interactive commands, press h.


This is well suited to perform the most trivial tasks when viewing text. She has a simple syntax, few options and a small amount of additional control over the output, however, sometimes this set is more than enough.


(Visited 4 times, 1 visits today)