Using script to Capture Console Output

Taken from this FreeBSD Forum thread which I found to be quite useful, to capture console output to a text file, you can do this:

$ script /tmp/filename.txt
Script started, output file is filename.txt
$ <enter command here>
$ ...
$ exit

Script done, output file is filename.txt

The file filename.txt will then have a record of everything that was output to the terminal. See the man page for more details.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License