LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I'd like my cake & eat it too please! Log to both console and file (https://www.linuxquestions.org/questions/linux-software-2/id-like-my-cake-and-eat-it-too-please-log-to-both-console-and-file-296163/)

ericcarlson 03-01-2005 04:00 AM

I'd like my cake & eat it too please! Log to both console and file
 
I have a bash job I run from a terminal which I just monitor from the screen. Now I have a need to do that and also log to file. If I use sh mybatch.sh > file.log I lose the console output. How can I do both please? Thanks

druuna 03-01-2005 04:07 AM

Hi,

Take a look at the tee command.

command | tee outfile

hope this helps.


All times are GMT -5. The time now is 08:55 AM.