CompTIA
XK0-005 · Question #1518
A systems administrator is checking the system logs. The administrator wants to look at the last 20 lines of a log. Which of the following will execute the command?
The correct answer is B. tail -n 20. The tail command is used to display the end of a file. The -n flag specifies the number of lines to display. So tail -n 20 outputs the last 20 lines of a file or input. The -c flag specifies bytes (not lines), -v enables verbose header output (not line count), and -l is not a…
System Management
Question
A systems administrator is checking the system logs. The administrator wants to look at the last 20 lines of a log. Which of the following will execute the command?
Options
- Atail -v 20
- Btail -n 20
- Ctail -c 20
- Dtail -l 20
How the community answered
(37 responses)- A3% (1)
- B92% (34)
- C5% (2)
Explanation
The tail command is used to display the end of a file. The -n flag specifies the number of lines to display. So tail -n 20 outputs the last 20 lines of a file or input. The -c flag specifies bytes (not lines), -v enables verbose header output (not line count), and -l is not a valid tail option. Therefore, the correct answer is B.
Topics
#Linux commands#Log management#File viewing#tail command
Community Discussion
No community discussion yet for this question.