Need a command...
Hi everybody!
Can someone tell me how it is possible to get a textfile printed on the screen and if a new entry will be added the output will be automaticly be updated with the last line. i.e. File test1.txt: Line1 -> Hello Line2 -> bla, bla, bla... --> Print file (Line1/2) on screen... A Program added Line 3 As soon as the program added the Line the command should also print the added line to the konsole. I need this for monitoring. THX |
To log a process you can do this: 'command >> command.log &'
Then to monitor that log do this: 'tail -f command.log' |
tail -F
|
Thx
Nis & Demonbane |
more explanation just for fun.
the -f option means follow, and keeps tail open, and keeps doing tail when the file changes. the >> option means to append to a file instead of overwriting it.a single > would overwrite the file each time instead. the & at the end of the line means give me back the prompt and do this in the background. you can bring it back to the foreground with fg and then kill or suspend the process with control-c or control-z. if you control-z, you can run fg and the process will resume in the foreground, or you can run bg and it will resume in the background. |
All times are GMT -5. The time now is 08:44 PM. |