The following does not work...
tail -f /var/log/mysql/general.log | grep Connect > /home/myfile.txt
If I remove the "-f" switch then I am able to save the output to a text file, but it does not work wile tail is running.
Nor does tee works
tail -f /var/log/mysql/general.log | grep Connect -tee "/home/myfile.txt"
update
Command provided by quanta does work.
tail -f /var/log/mysql/general.log | tee >(grep Connect > /home/myfile.txt)
But I have to keep the window open. nohup tail -f ... does not seem to work. How do I keep this command running continuously?