Thursday, December 9, 2010

Record Bash session to a file

Record a bash session with script. Another way to record a session is to redirect stderr into stdout, and the tee the output to both the original stdout and a file. This program is much simpler, and may pick up a few messages that seem to try to go around the stderr redirect in some programs you may run.

The script command is usually a no-brainer to use. When you're ready to start recording the input/output of your login session, just type:

script

at the command line. You'll get a message back from the operating system that looks like this: