/ factorpad.com / tech / linux-essentials / more-command.html
An ad-free and cookie-free website.
Beginner
Learn to view text files at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux more Command Summary with Examples (3:43)
Our fifty-fifth word, or command to memorize is
more
from our category
Text.
more
allows you to view text files.
-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.
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
.
And that'll be something we can play with here.
Next, type more
and that filename
video55.txt
.
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.
And last, just as with pg
and
less
, we'll type
q
to leave.
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.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
Are you watching, reading and keying these commands? Using all three makes learning faster.
pg
command,
hit Back.emacs
, click Next./ factorpad.com / tech / linux-essentials / more-command.html
A newly-updated free resource. Connect and refer a friend today.