Paging Through Large Files
Concept & Overview
Peeking at the top and bottom of a file with head and tail is great, but what if you need to browse a long configuration file page-by-page? That's what pagers like less and more are for.
- Pagers load files interactively, showing one page of text at a time to prevent system slowdowns on large files.
- less logs.txt is the modern choice, allowing you to scroll both forward and backward using the arrow keys, search text with /, and exit by pressing q.
- more logs.txt is an older, simpler pager that only scrolls forward.
less logs.txt or more logs.txt (or /etc/hosts) to open it in a scrolling view. (In our terminal, this will output the contents in a scrollable frame. Press q to return).Command Syntax Reference
| Command / Syntax | Description |
|---|---|
less logs.txt | Open logs.txt in the less pager |
more logs.txt | Open logs.txt in the more pager |
less /etc/hosts | Open hosts file in the less pager |
more /etc/hosts | Open hosts file in the more pager |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Open logs.txt or /etc/hosts in a pager (less or more)
Ready to complete Quest 15?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.