Using tee to create a log

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Kevin Buettner
Dátum:  
Tárgy: Using tee to create a log
On Jul 26, 11:25am, Alan Dayley wrote:

> I have a command line utility that spits out data on the screen as it runs.
> I want to capture this data to a "log" file so I can read it later. I
> have been told the tee command will do this for me but I can't seem to get
> the command line correct as the log file is always empty.
>
> The man and info pages are not very helpful to me since I am just learning
> this piping commands stuff.


Do it like this:

    myscript | tee logfile


You might also find the following useful:

    myscript >logfile &
    tail -f logfile


Kevin