Capturing cli Program output

A few years ago I took a C programming class and used both Linux and FreeBSD as my operating systems and gcc as the compiler. I ran a Command-line utility to to capture what happened as I ran the code, the output was saved to a file that I specified when I ran the utility command (that I can't remember the name of:( ). The file I then printed and turned in as results to my instructor. I am enrolling in another programming class and I can't remember what the command was I used to capture the I/O. I appreciate any help, Thanks.

Chris

The script command makes a copy of a terminal session.