SunQuest
           UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 22nd, 2003, 11:08 AM
jwolfe jwolfe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 38 jwolfe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Stopping a "tail -f file"

Is it possible to stop a tail -f on a log file. It keeps looping and checking if the file has been updated, which is what I need, but is there any way of stopping it once it starts.

tail -f LOG

Reply With Quote
  #2  
Old August 22nd, 2003, 03:15 PM
Prime Mover Prime Mover is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Jersey
Posts: 64 Prime Mover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Depends on if you're running it from a script or not. The usual way to kill a tial -f is to issue a <ctrl>-c to it, that will stop the tailing to the screen.

If in a script, I believe you'd have to issue the same, but inside the script.

Reply With Quote
  #3  
Old August 22nd, 2003, 03:22 PM
jwolfe jwolfe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 38 jwolfe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I can't even kill the tail -f from the command line with <ctrl>-c not to mention the C proram that implements it.

Reply With Quote
  #4  
Old August 22nd, 2003, 03:29 PM
Prime Mover Prime Mover is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Jersey
Posts: 64 Prime Mover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Ok then, have you tried to kill the pid?

Find out what the pid is:

ps -ax | grep tail (Linux, FreeBSD)

ps -ae | grep tail (Solaris)

It should give you output like:

bash-2.03$ ps -ae |grep tail
18794 pts/21 0:00 tail

Then, kill it for good:

bash-2.03$ kill -9 18794

Obviously, substitute your number for the above.

If no results come up in the grep, then try grepping for the parent program name, i.e. the program which is calling the tail.

-Gary

Reply With Quote
  #5  
Old August 22nd, 2003, 03:34 PM
jwolfe jwolfe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 38 jwolfe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thank you, I figured it out.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Stopping a "tail -f file"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway