Você pode usar o comando script .
Extraído do manual:
The script utility makes a typescript of everything printed on your terminal.
It is useful for students who need a hardcopy record of an inter- active session as proof of an assignment, as the typescript file can be printed out later with lpr(1).If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript.
If the argument command is given, script will run the specified command with an optional argument vector instead of an interactive shell.
Exemplo (informação no arquivo typescript):
Script started on Mon Nov 2 21:13:17 2009
bash-3.2$ pwd
/Users/ricbax
bash-3.2$ ps
PID TTY TIME CMD
395 ttys000 0:00.02 -bash
425 ttys000 0:00.00 script
426 ttys001 0:00.01 /bin/bash -i
bash-3.2$ exit
exit
Script done on Mon Nov 2 21:13:44 2009