to check the latest lines of log in vi editor itself..


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers to check the latest lines of log in vi editor itself..
# 1  
Old 05-29-2012
to check the latest lines of log in vi editor itself..

Hi Folks,

If I open the logs in vi editor but as the logs get update after few seconds and I want to see the latest lines then whats the command to see the latest lines in vi editor itself , lets say I have open a log named abc.log in vi..!!
Code:
vi abc.log

# 2  
Old 05-29-2012
When you open with vi, you will see what is in the file at that instant. What is displayed on your screen will not change as changes happen to the original file.

To see the end of a file, check out the
Code:
tail

command.
# 3  
Old 05-29-2012
To check the file as it grows:
Code:
tail -f /path/to/file

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check if a file is open in editor?

Hi there! I'm developing a program that allows the user to open and edit files using both an editor and the terminal. Once the user has finished editing the file an update is sent to the logbook that compares the file before and after it was edited - this can only be done if the file is closed (I... (23 Replies)
Discussion started by: cherryTango
23 Replies

2. UNIX for Dummies Questions & Answers

Want to remove all lines but not latest 50 lines from a file

Hi, I have a huge file which has Lacs of lines. File system got full. I want your guys help to suggest me a solution so that I can remove all lines from that file but not last 50,000 lines. I want solution which can remove lines from existing file so that I can have some space left with. (28 Replies)
Discussion started by: prashant2507198
28 Replies

3. Shell Programming and Scripting

Check/Parse log file's lines using time difference/timestamp

I was looking at this script which outputs the two lines which differs less than one sec. #!/usr/bin/perl -w use strict; use warnings; use Time::Local; use constant SEC_MILIC => 1000; my $file='infile'; ## Open for reading argument file. open my $fh, "<", $file or die "Cannot... (1 Reply)
Discussion started by: cele_82
1 Replies

4. Shell Programming and Scripting

Check latest patch applied on UNIX server

hi all, i need to check the latest patch applied on my unix server. here is the server info: bash-3.2$ uname -a SunOS usa0300uz1226 5.10 Generic_148888-01 sun4u sparc SUNW,SPARC-Enterprise please tell which is the command for checking patch? (1 Reply)
Discussion started by: lovelysethii
1 Replies

5. Shell Programming and Scripting

How to check binary files in VI editor?

Hi, i have a file that contain both text and binary inside the file.. i want to see the binary part.. how can i check that ? (2 Replies)
Discussion started by: mail2sant
2 Replies

6. UNIX for Advanced & Expert Users

Check latest time where theres the word 'processed' in logfile

Hi, Im doing a project to check the latest time with the word 'processed' in a logfile. the time range is within 2 hours before the curent datetime to present. For example: Current datetime is 'October 6 2009 8:00AM' --- HKT So the time range that need to check is from 'October 6... (1 Reply)
Discussion started by: romanne
1 Replies

7. UNIX for Dummies Questions & Answers

To check if the latest version of given GDG base has data

Hi All , I am trying to run a shell script through a JCL . The requirement is I have a gdg base name and I need to create a script that will just check if the latest version of that gdg has data or not . If it doesnt have data RC 4 need to be returned . One more thing which is bothering me is i... (1 Reply)
Discussion started by: mavesum
1 Replies

8. Shell Programming and Scripting

To check if the latest version of given GDG base has data

Hi All , I am trying to run a shell script through a JCL . The requirement is I have a gdg base name and I need to create a script that will just check if the latest version of that gdg has data or not . If it doesnt have data RC 4 need to be returned . One more thing which is bothering me is i... (3 Replies)
Discussion started by: mavesum
3 Replies

9. Shell Programming and Scripting

vi editor - interchange two lines

Hi, I have a quick question regarding vi editor.Is it possible to interchange two lines in vi editor without using the possibilites of cut-paste,copy paste etc? Your help is appreciated! Regards Dileep (4 Replies)
Discussion started by: DILEEP410
4 Replies

10. Shell Programming and Scripting

Reading lines within vi editor

Hi All, I need to read line by line from a file(created using vi editor) till end of the file and pass it to my own executables so that it will read first line and execute and then other and so on...Thanks The steps are like this; 1) read first line in file 2) execute the job with first line as... (2 Replies)
Discussion started by: asriva26
2 Replies
Login or Register to Ask a Question