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


          • #6
            The application will often create special files of the pipe type that can be used to link ... The above command will show all settings and their current state. ... Note: The log file used here is on Ubuntu on other systems the more general log file ...

            Comment

            Working...
            X