parsed.org

Tips by tag: stdout

Save and View Pipe Stream by xinu on Mar 10, 2005 01:37 PM

You can use the tee program to save the contents of a pipe to a file while also viewing it on standard out:

# tail -0f /var/log/httpd/error_log | tee ~/newest_errors.txt

Note: tail -0 instructs tail to begin at the very end of the file (the default is to show the last ten lines), and -f means tail will periodically check the file for additional data and print the data to standard out.

commandsdebuggingmonitoringpipeshellstdouttailteeutilities
RSS