|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
I can't even kill the tail -f from the command line with <ctrl>-c not to mention the C proram that implements it.
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
Thank you, I figured it out.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Stopping a "tail -f file" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|