InMotion Hosting Support Center

The more command is used to display a small portion of a file at a time. If you wish to see the next entire page, simply press the spacebar. Pressing the enter key will simply display the next line of the file. This allows you to browse a file as you desire. It also takes a numeric argument to allow you to display only a certain number of lines initially, or to even begin at a specific line number.

Command: more
Synopsis: more [OPTION] [-num] [+/ pattern] [+ linenum] [file ...]

Options:
Option Description
-c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed.
-d More will prompt the user with the message "[Press space to continue, 'q' to quit.]" and will display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed.
-f Causes more to count logical, rather than screen lines (i.e., long lines are not folded).
-l More usually treats ^L (form feed) as a special character, and will pause after any line that contains a form feed. The -l option will prevent this behavior.
-num This option specifies an integer which is the screen size (in lines). For example, if you want to use the more command and only see only 5 lines, you would use more -5 test.txt.
-p Do not scroll. Instead, clear the whole screen and then display the text.
-s Squeeze multiple blank lines into one.
-u Suppress underlining.
+/ The +/ option specifies a string that will be searched for before each file is displayed.
+num Start at line number num.

Examples

Base Command

more - In this example, we use the base more command on a file named test.txt. Note at the bottom it tells how much of the file is viewable. In this case, 11%. Pressing the Enter key will reveal the next line in the file.

# more test.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi convallis vehicula nisi.
Cras consequat consectetur lectus in cursus.
Ut vulputate interdum arcu, imperdiet sodales nisl adipiscing vitae.
Quisque blandit urna eu neque consectetur, sit amet scelerisque est dapibus.
Donec ut euismod arcu.
Vivamus sed urna ut eros blandit scelerisque et laoreet magna.
Sed vestibulum mauris quis dolor venenatis sagittis.
Cras hendrerit cursus turpis vitae volutpat.
Donec adipiscing sagittis enim nec lacinia.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Quisque aliquam purus id facilisis lacinia.
--More--(11%)

Command with directions

more -d - You can think of -d as the 'direction' switch. It prints directions at the bottom of the print. It also prints a help message if the user presses an illegal key. Below we first demonstrate the directions.

# more -d test.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi convallis vehicula nisi.
Cras consequat consectetur lectus in cursus.
Ut vulputate interdum arcu, imperdiet sodales nisl adipiscing vitae.
Quisque blandit urna eu neque consectetur, sit amet scelerisque est dapibus.
Donec ut euismod arcu.
--More--(5%)[Press space to continue, 'q' to quit.]
And if the user tries to use an improper command: # more -d test.txt Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi convallis vehicula nisi. Cras consequat consectetur lectus in cursus. Ut vulputate interdum arcu, imperdiet sodales nisl adipiscing vitae. Quisque blandit urna eu neque consectetur, sit amet scelerisque est dapibus. Donec ut euismod arcu. [Press 'h' for instructions.]

Display certain number of lines

more -num - This option allows you to control the number of lines displayed on the screen. In this example, we only want to show 5 lines on the screen.

# more -5 test.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi convallis vehicula nisi.
Cras consequat consectetur lectus in cursus.
Ut vulputate interdum arcu, imperdiet sodales nisl adipiscing vitae.
Quisque blandit urna eu neque consectetur, sit amet scelerisque est dapibus.
Donec ut euismod arcu.
--More--(1%)

String Search

more +/ - This command searches for a string before printing that information on the screen. Below we search for the string 'Mauris'. Note that it added a prefix '...skipping' at the top before beginning the printout.

# more +/'Mauris' test.txt
...skipping
Nunc quis egestas quam.

Mauris ac viverra leo.
Cras vehicula magna dolor, sed pharetra tortor condimentum et.
Nullam ante dui, gravida in ante eget, auctor convallis mauris.
Aenean in blandit libero. Nunc suscipit ultrices odio quis tristique.
Proin feugiat turpis elit, et semper turpis pretium sit amet.
Praesent ultrices, dui consequat commodo ultricies, velit enim pulvinar libero, posuere consectetur turpis quam vel est.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aliquam cursus diam nunc, nec porttitor elit gravida eu.
Donec in neque sapien. Suspendisse porta odio id fermentum placerat.
Vivamus aliquam libero id purus bibendum hendrerit.
Vivamus molestie eleifend lacus in luctus.
Donec vitae lectus eget ligula cursus dapibus.
Mauris sollicitudin turpis non mi mattis sodales.
Pellentesque vel justo est.
--More--(13%)

Start on specific line number

more +num - By using the +num otpion (where num is an actual number), the more command will begin at that line number. In this example, we begin at line 5.

# more +/'Mauris' test.txt
Donec ut euismod arcu.
Vivamus sed urna ut eros blandit scelerisque et laoreet magna.
Sed vestibulum mauris quis dolor venenatis sagittis.
Cras hendrerit cursus turpis vitae volutpat.
Donec adipiscing sagittis enim nec lacinia.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Quisque aliquam purus id facilisis lacinia.
Sed id rhoncus augue, convallis imperdiet sem.
Nunc quis egestas quam.
--More--(12%)

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!