Announcement

Collapse
No announcement yet.

Displaying a particular number of lines from the log file on the terminal

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Displaying a particular number of lines from the log file on the terminal

    Hello,
    How can I display a particular number of lines from the .log file on a terminal?

    I have tried the following command to display 7 lines, but getting the error "Invalid numbers of lines".
    tail -n 7/access.log

  • #2
    How many lines are available in the .log file? Is more than 7 lines?

    Comment


    • #3
      Originally posted by Gabrel View Post
      How many lines are available in the .log file? Is more than 7 lines?
      There are 16 lines in the .log file.

      Comment


      • #4
        The right syntax is: tail -n 7 access.log

        Or just

        tail -7 access.log

        Comment


        • #5
          Originally posted by Nimbus View Post
          The right syntax is: tail -n 7 access.log

          Or just
          Thanks, it worked. Much appreciated.

          Comment

          Working...
          X