I need to basically see the output of a command which are logs that could run into 1000+ lines while at the same time send it to a file. please help.
Asked
Active
Viewed 3,554 times
2 Answers
4
Use the tee command:
mycommand | tee filename.txt
Will run mycommand saving standard output to filename.txt while also displaying it on the terminal.
nimrodm
- 156
-1
Instead of trying to duplicate the output (I/O is expensive!), how about writing to the file and opening a separate terminal and using tail -f <file>.log at the same time?
kiminoa
- 101