[Ilugc] Log file viewing help

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Thu Oct 19 12:49:31 2006

On Thu, Oct 19, 2006 at 01:49:02AM -0500, carti wrote:

I need to view the log file in a unix box. The log file will keep on
getting updated as it is a production box.

Earlier I used the "tail -f " option to see the last part of the file.
That showed the latest update in the file continuously whenever the file
got updated.

Now if I want to see the log file going up and down I am not able to see
using the 'tail -f' command as it would only show the latest tail portion.
Binand has already told u what was on my mind. :-)

Is there some way to open a continuously getting updated file(such as
production log file) in 'vi' editor so that I can go up and down the page
of the file. At the same time the file/buffer should also get updated with
the latest changes(may be by key press like ctrl-R or similar) but without
the need to close and open the file.
You are better off writing a vim script. I just took a look at it and looks 
simple to me. But unfortuately I have not written one for your need. If you 
need help please let me know. I may be able to do it. But you can too! :-)

Also How can I open multiple file by spliting the vi screen(without using
splitvt tool) so that I can see and scroll different log files
simultaneoulsy in a single screen and in a single session.
vim 7.0 has a nice tabbed feature.

$vim -p file1 file2

And you can very easily switch between tabs using "gt" hotkey.

i.e, press g followed by t in command mode. 

It is really hard explaining vi in English. :-)

If you don't have 7.0, it is very easy to compile it urself. It has few other 
nice features as well. Just a straight configure make make install works.

Best,
Girish

Other related posts: