FactorPad
Build a Better Process

Linux more Command Summary with Examples

Linux more allows you to view text files.
  1. Purpose - Learn what more is for and how to find help.
  2. Options - Review a few common options and arguments.
  3. Examples - Walk through code examples with more.
  4. A tip - Finish off with one more insight.
face pic by Paul Alan Davis, CFA
Updated: February 24, 2021
In this tutorial on Linux more, 55 of 100, below find a 3-4 minute introductory video, a text-based tutorial and all of the code examples from the video.

Outline Back Tip Next

/ factorpad.com / tech / linux-essentials / more-command.html


An ad-free and cookie-free website.


Examples of the Linux more Command

Beginner

Learn to view text files at the Linux command line.

Video Tutorial

Videos can also be accessed from the Linux Essentials Playlist on YouTube.

Linux more Command Summary with Examples (3:43)

Video Script

The Command and Why You Need It

Our fifty-fifth word, or command to memorize is more from our category Text.

more allows you to view text files.

Common Linux more Options
-options description
-h Print help screen
h Show internal commands
q Quit more

Recall from video 5 and 54, I'm introducing several page viewers. I said less is my preferred pager, but to be fair, I'm running other choices by you and this is the third and final pager we'll review, before covering editors in the next few videos (tutorials).

Before we start, it helps to think of commands as mini programs and most follow this structure: command -option(s) argument(s).

The more command has 10 options and the argument is a text file to view, and because more is a unique program it has its own internal commands, and there are about 18 in there.

Unlike most commands, help isn't accessed with double-dash, so use -h. And then once you're inside more, view internal commands with h, and q to leave.

So why is more an important command? Well, pagers are highly personal and memorizing internal commands helps with your speed, so it's up to you to find your go-to pager. And now you know how to do that.

Demonstration

Okay, the best way to embed this in your memory is by typing in your own terminal window.

Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.

Here we go. Let's get the man page for more and redirect it > to a text file called video55.txt.

$ man more > video55.txt

And that'll be something we can play with here.

Next, type more and that filename video55.txt .

MORE(1) User Commands MORE(1) NAME more - file perusal filter for crt viewing SYNOPSIS more [options] file... DESCRIPTION more is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements. OPTIONS Options are also taken from the environment variable MORE (make sure to precede them with a dash (-)) but command-line options will override those. -d Prompt with "[Press space to continue, 'q' to quit.]", and display "[Press 'h'for instructions.]" instead of ringing the bell when an illegal key is pressed. -l Do not pause after any line containing a ^L (form feed). -f Count logical lines, rather than screen lines (i.e., long lines are not folded). -p Do not scroll. Instead, clear the whole screen and then display the text. Notice that this option is switched on automatically if the executable is named page. -c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each der of each line as it is displayed. -s Squeeze multiple blank lines into one. --More-- (26%)

And when I hit Enter the Enter command, you see how it goes line by line? It pages that way. This can be helpful, but it can also be tiresome. Also, this DESCRIPTION (section above) here is worth reading. Okay.

And then down here, I like this feature. The percent of file seen, (pointing to --More--(26%) in the bottom left corner of more), but I do quantify things more than most people.

Then hit h, for the internal commands and they're shown inline, and then Enter keeps going (continue scrolling). That's a nice feature.

--More--26% Most commands optionally preceded by integer argument k. Defaults in brackets. Star (*) indicates argument becomes new default. ------------------------------------------------------------------------------- <space> Display next k lines of text [current screen size] z Display next k lines of text [current screen size] <return> Display next k lines of text [1]* d or ctrl-D Scross k lines [current scroll size, initially 11]* q or Q or <interrupt> Exit from more s Skip forward k lins of text [1] f Skip forward k screefuls of text [1] b or ctrl-B Skip backwards k screenfuls of text [1] ' Go to place where previous search started = Display current line number /<regular expression> Search for kth occurrence of regular expression [1] n Search for kth occurance of last r.e [1] !<cmd> or :!<cmd> Execute <cmd> in a subshell v Start up /usr/bin/vi at current line ctrl-L Redraw screen :n Go to kth next file [1] :p Go to kth previous file [1] :f Display current file name and line number . Repeat previous command ------------------------------------------------------------------------------- -u Supress underlining. -number The screen size to use, in number of lines --More--(28%)q $ _

And last, just as with pg and less, we'll type q to leave.

A Final Tip

Okay now you know how to use more. And you know the syntax for commands, options and arguments.

One last tip about the more command. So a fun little fact, the program less improved on more, and was named less as a result. Hmm ;).

Okay, thanks for visiting today. I hope this was a helpful introduction to the more command.


Learn More About The Series

For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:


What's Next?

Are you watching, reading and keying these commands? Using all three makes learning faster.

Outline Back Tip Next

/ factorpad.com / tech / linux-essentials / more-command.html


linux more command
more linux
linux more examples
unix more
more unix
linux more command examples
linux pager
linux command more
linux more examples
linux file pager
linux more options
linux more tutorial
linux more search
more command in linux
linux more command tutorial
more text viewer
linux more command syntax

A newly-updated free resource. Connect and refer a friend today.