nerdexam
Linux_Foundation

LFCS · Question #754

Which of the following commands will display the last 30 lines of /var/log/bigd.log as well as new content as it is appended to the file by another process?

The correct answer is C. tail-f-n 30/Var/log/bigd.log. The tail command with the -f and -n options displays the last specified number of lines of a file and then continues to output new content as it is appended.

Submitted by ravi_2018· Apr 18, 2026Essential Commands

Question

Which of the following commands will display the last 30 lines of /var/log/bigd.log as well as new content as it is appended to the file by another process?

Options

  • Acut-30-v/var/log/bigd.log
  • BheaD.30-e/var/log/bigd.log
  • Ctail-f-n 30/Var/log/bigd.log
  • DtaC.30/var/log/bigd.log
  • Ecat-r-n 30/var/log/bigd.log

How the community answered

(26 responses)
  • C
    88% (23)
  • D
    4% (1)
  • E
    8% (2)

Why each option

The `tail` command with the `-f` and `-n` options displays the last specified number of lines of a file and then continues to output new content as it is appended.

Acut-30-v/var/log/bigd.log

The `cut` command is used for extracting sections from lines of files and does not have options to display last lines or follow file content.

BheaD.30-e/var/log/bigd.log

The `head` command displays the *first* lines of a file, not the last, and the `-e` option is not a standard way to follow file content.

Ctail-f-n 30/Var/log/bigd.logCorrect

The `tail` command is used to display the end of a file. The `-n 30` option specifies to show the last 30 lines, and the `-f` (follow) option keeps the command running, continuously outputting new data that gets appended to `/var/log/bigd.log` by another process, which is ideal for real-time log monitoring.

DtaC.30/var/log/bigd.log

The `tac` command prints lines in reverse order, and `taC.30` is not valid syntax for displaying last lines or following a file.

Ecat-r-n 30/var/log/bigd.log

The `cat` command concatenates and displays entire file contents and lacks options to show only the last lines or to follow appended content.

Concept tested: tail command for log monitoring

Source: https://man7.org/linux/man-pages/man1/tail.1.html

Topics

#tail command#log file monitoring#command line utilities

Community Discussion

No community discussion yet for this question.

Full LFCS Practice