more
Overview
The more
command is a file perusal filter for viewing text one screen at a time. It’s simpler than less
but still useful for basic file viewing.
Syntax
more [options] file...
Common Options
Option | Description |
---|---|
-d |
Display help prompt |
-f |
Count logical lines |
-l |
Suppress line-break treatment |
-s |
Squeeze multiple blank lines |
-u |
Suppress underlining |
-5 |
Screen every 5 lines |
-p |
Clear screen before display |
+/pattern |
Start at pattern |
+num |
Start at line number |
Key Use Cases
- View text files
- Read documentation
- Display command output
- Basic file navigation
- Quick file inspection
Examples with Explanations
Example 1: Basic Usage
more file.txt
View file one screen at a time
Example 2: Start at Pattern
more +/pattern file.txt
Start viewing at first occurrence of pattern
Example 3: Line Numbers
more +5 file.txt
Start viewing from line 5
Understanding Output
Commands during viewing: - Space: Next page - Enter: Next line - b: Previous page - /pattern: Search pattern - =: Show current line number - q: Quit - h: Help
Common Usage Patterns
View with line numbers:
more -d file
Squeeze blank lines:
more -s file
Pipe command output:
command | more
Performance Analysis
- Simple and lightweight
- Forward-only scrolling
- Limited memory usage
- Quick startup
- Basic feature set
Additional Resources
Limitations
- No backward scrolling
- Limited search capabilities
- Basic feature set
- No file editing
- Single file viewing
Best Practices
- Use for quick views
- Consider less for large files
- Use with pipes
- Learn key commands
- Know when to switch to less