Find the answer to your Linux question:
Results 1 to 9 of 9
Hi, I can't remember the command to look at the log while its been writen to I think you use the grep command but I am not sure....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2006
    Location
    UK, Devon
    Posts
    41

    Showing Contents of A live log file


    Hi,
    I can't remember the command to look at the log while its been writen to I think you use the grep command but I am not sure.

  2. #2
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi Luke_C,
    What kind of log file are you referring to? Can you give more details as to exactly what you intend to do?

    With Regards,
    Thinker

  3. #3
    Just Joined!
    Join Date
    Apr 2006
    Location
    UK, Devon
    Posts
    41
    Hi M8,
    Please call me Luke and what I want to do is have a live viewing of a log file like access.log for squid so I can see live whats been accessed I have not used the command in a while and forgot what its called.

    I know cat works but I have to type that each time. I know there is such a command cant remember for the life for me what it is.

  4. #4
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi Luke,
    You can call me Thinker.

    Well, if you open the file of interest in NEdit, then everytime any other process edits the file and saves it, NEdit will prompt you to reload the changed file or dismiss it.

    With Regards,
    Thinker

  5. #5
    Just Joined!
    Join Date
    Apr 2006
    Location
    UK, Devon
    Posts
    41
    Thats not what I want to do dude.

    I want to see the output in my console as the file gets updated.

  6. #6
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,286
    Hi.

    I've used tail -f file to follow the file content as it is being generated. See man tail for details beyond that ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  7. #7
    Just Joined!
    Join Date
    Apr 2006
    Location
    UK, Devon
    Posts
    41
    Thanks thats the one lol

    Looked in my book and notes for ages for that many thanks dude

  8. #8
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi Luke,
    Well, you can also write a simple script to read the current timestamp of the file and display using cat or tail and then check when the timestamp has been modified. If modified, read the new timestamp and go on in a loop.

    With Regards,
    Thinker

  9. #9
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    tail -f

    E.g.,
    Code:
    $ tail -f /var/log/ntpd
    Stand up and be counted as a Linux user!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •