Difficulty: Easy
Correct Answer: tail
Explanation:
Introduction / Context:
When troubleshooting logs or monitoring activity, it is often necessary to see the most recent lines appended to a file. Unix provides a dedicated utility for this purpose, enabling both static viewing and live following.
Given Data / Assumptions:
Concept / Approach:
The tail utility prints the final portion of files. Common flags include -n for a specific number of lines and -f to follow file growth in real time (useful for log monitoring). Other listed options either do something else or are not valid commands.
Step-by-Step Solution:
Verification / Alternative check:
Running tail /etc/passwd on a Unix system prints the last 10 entries. Adding -f keeps the file open and prints new additions as they occur, confirming its role for end-of-file viewing.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing 'head' and 'tail'; expecting -f to terminate automatically; forgetting to use sudo or appropriate permissions when tailing protected logs.
Final Answer:
tail
Discussion & Comments