New answers tagged

5

This does what you need: sh -c 'tail -f file & cat' | tee file2 Note, it duplicates your comments for the terminal output when you press enter. It works also with {...} and (...) instead of sh -c, but then tail -f won't stop running when you press ctrl+c.


-1

Use Tee tail -f /var/log/messages | tee test.txt


2

(Assuming you're using Linux) Use echo $$ to get the PID of your current shell. Open a new terminal, and run: sudo strace -fp <PID> -o log Switch back to the old shell, try tab completion. Then switch to the new terminal and press CtrlC to end strace. The output will be in the file named log. You could also run the strace command in the same shell (...


Top 50 recent answers are included