Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I'm looking for a tool that will do a job similar to "tail -f". I have a file that is being modified at certain intervals and I want to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    3

    Question Looking for a file viewer that will react to file changes


    Hi,


    I'm looking for a tool that will do a job similar to "tail -f". I have a file that is being modified at certain intervals and I want to open that file and see these modifications as they happen.

    "tail -f" will only show new lines that are appended to the end of a file and what I need is something that will reflect any changes to the file content anywhere in the file at some specified intervals.


    Thanks

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    Well,
    to show differences, you need the previous version.

    I dare not mention some hackish attempts with cp, mv and diff as they will surely fall apart as soon as we are talking about bigger files or low latency.

    Also I do not know the size or content of the file, nor the update interval.
    If possible, can you implement subversion commits?
    Or any other version control system for that matter?

    Then you can see any change and even restore these.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    3
    Thanks for your reply Irithori, but it's not exactly what I'm after. It looks like my question wasn't entirely clear. I'll better clarify what I need.

    I don't want to perform a diff, or highlight new stuff, what I want is simply to have a file reloaded automatically whenever it's modified.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    You might want to look into the inotify facilities. You can watch for changes to a file, directory tree, or file system. You can script it to read/refresh your view of a file of interest when its contents are modified.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Sep 2010
    Posts
    3
    Thank you, I will look into that tool.

Posting Permissions

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