Using tee

I have been using the command tee to store the output to a file and also write on the terminal. However I would need to put the program in the background although I would still need to see the file being updated like it was doing when using tee.

Any suggestions on how to look at the log file whilst it's being updated?

background means you cannot write to your terminal.

Login to a second process (assuming you are not on the console) start your update using tee, and then switch back and forth. Without an extra login, you can also use batch or at to run it without tee and then take a peek at the logfile with tail or tail -f.

The problem with tail -f is that there is a delay between what's being written to the file and what tail outputs.

I have removed using tee and I just redirect to a file. But still want to look at the file being updated. My problem with tee is that if my computer gets in sore sort of problem and have to restart or something, the program will be killed. I am putting the command to run the program on my computer but am running the thing on other machines.

Use or install the very usefull tool called "screen" or "GNU screen", you could then launch your script and detach your session so it is just "as if" it was running in background, and you can reattach to your session later