Page Through Text with more
Page Through Text with more
Sometimes you encounter more on a system or in an older command example. It is another pager: it presents text in manageable portions instead of sending a long report through the terminal all at once. Think of its keys as instructions for the current view, not changes to the file.
The features of a particular more implementation can vary. We will use the basic forward-paging behavior and keep the central idea clear: reading a screen of text is separate from editing the saved student list.
What you’ll learn
- Read a report through the more pager.
- Distinguish moving a line, moving a screen and leaving the pager.
Pager keys change the view, not the saved text
Open
more starts displaying the existing class list.
more students.txtAdvance
Space moves approximately one screen; Enter commonly moves a line.
next part of reportLeave
q exits the pager; viewing alone has not modified the file.
report unchanged
Read a prepared class list one screen at a time
Prepare the example
Use an interactive terminal with more installed. The first line prepares a small class list. A short file can fit on the screen and the pager may finish immediately; use a longer disposable list when you want to experience several full pages.
Bash · Linux terminal
printf 'Diya\nSaira\n' > students.txt
more students.txtExpected behavior; machine-dependent details
Interactive view; Space advances and q quits.more students.txt opens the prepared text. When it pauses for another portion, Space normally advances approximately a screen and Enter advances a line. These keys change how much of the file you see, not the student names stored in it.
You can press q to leave while the pager is active. When the file ends, the behavior depends on the implementation and settings, so do not expect the small exercise to produce an identical pause on every terminal. For more flexible navigation and searching on systems that provide it, compare less rather than assuming both pagers have precisely the same controls.
Paging keys and input from a pipe
more displays text one screen at a time instead of sending all output past you immediately. It is a simple pager and is commonly available on Unix-like systems.
Open a terminal and prepare a sample file
Let’s start by opening a terminal. If you’re on macOS, just hit Command + Space and type “Terminal”. On Linux, use Ctrl + Alt + T.
Step 2: Create a Sample File (Optional)
If you don’t have a big file to test with, let’s create one:
seq 1 100 > numbers.txt
This command creates a file called numbers.txt with numbers from 1 to 100, one per line.
Step 3: View the File Using more
Now let’s open the file using more:
more numbers.txt
You’ll see the first page of the file like this:
1
2
3
...
22
--More--
⏩ Navigation Tips
While you're viewing a file with more, here are a few useful keys:
- Space – Go to the next page
- Enter – Go down one line
- q – Quit and exit the viewer
Bonus: Use more with Piping
Let’s say you want to view the output of a command that produces lots of text — you can pipe it into more.
ls -lR /etc | more
This will list all files under /etc recursively and show them one screen at a time using more.
Page through text with more
more filename– View file contents one screen at a timeSpaceto scroll,qto quit- Use with commands like
ls,ps, ordmesgusing a pipe (|)
Try it, then check the worked answer
Your task: Advance approximately one screen in more.
Use an interactive terminal with more installed. The first line prepares a small class list. A short file can fit on the screen and the pager may finish immediately; use a longer disposable list when you want to experience several full pages.
Bash · complete example for this question
printf 'Diya\nSaira\n' > students.txt
more students.txtExpected behavior; machine-dependent details
Interactive view; Space advances and q quits.Worked answer
Press Space.
Use Space to advance about one screen in the normal paging interaction. Enter is useful for a smaller step. Rewriting the file with redirection would be a different operation entirely and is unnecessary just to see the next part of a report.
Check your decision
Move through the display without rewriting the file
A pager changes the view while leaving the saved text alone. Learn its movement and exit keys, and recognize that a short file may not need a pause. When following an unfamiliar example, check which pager is running rather than applying editor or shell controls to it.
Reaching the recap and completing the quizzes are separate milestones.