Difficulty: Easy
Correct Answer: pg
Explanation:
Introduction / Context:
When inspecting long text files in Unix, paging programs prevent content from scrolling off the screen. Different pagers offer varying controls and defaults; knowing the right tool improves productivity during log analysis and documentation review.
Given Data / Assumptions:
Concept / Approach:
The pg command is a historical pager that displays text a page at a time, with a default page length of 24 lines. It accepts commands for navigation and can also follow input from pipelines. Other utilities either print without paging or handle printing tasks, not interactive viewing.
Step-by-Step Solution:
Verification / Alternative check:
Running pg /etc/services presents the file in pages. Pressing space advances one page; q quits. This matches the requirement of viewing 24 lines at a time by default.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing 'pg' with 'more' and 'less'. While 'more' and 'less' are modern alternatives (with different defaults and features), the question’s historical default of 24 lines aligns with 'pg'. In many systems, 'less' is preferred for bidirectional navigation, but the specific command requested here is 'pg'.
Final Answer:
pg
Discussion & Comments