more

Command for listing/navigate large file content.

To navigate through the file:

  • Press the Space bar to move to the next page.

  • Press Enter to move down one line.

  • Press b to go back one page.

  • Press q to quit and return to the command prompt.

  • to check your actual line number press =

  • to start listing from specific line number (i.e from line 100)

    more +100 file_name

The more command allows you to customize how many lines are displayed at once. This can be helpful when you’re trying to view the file in smaller chunks.

  • Let’s display only 10 lines at a time. Use the more command with the - option followed by the number of lines:

    more -10 file_name

Now you can use same keys to navigate and you will navigate only with 10 lines

You can sometimes need to jump on specific line containing specific info. For example you want to find data for a specific date, like “2023-07-15”. Use the following command:

more +/"2023-07-15" file_name

The +/ before the search term tells more to jump to the first matching area for this pattern. Depending on your terminal and pager behavior, you may see one or more context lines before the exact match.

To find the next occurrence of the same pattern, you can:


Type / and press Enter (this repeats the last search)
 Or type /2023-08-15 and press Enter (this explicitly searches for the pattern again)

Additional more command options not covered in this lab include:

-d: Displays helpful prompts -f: Counts logical lines instead of screen lines -p: Clears the screen before displaying the page -c: Repaints the screen instead of scrolling -s: Squeezes multiple blank lines into one -u: Suppresses underlining