Gnome Terminal Logging – How to Enable Logging in Gnome Terminal

bashconsolegnomegnome-terminal

Is there any way to log every that was displayed in gnome-terminal?

for example I have a complex command

doSomethingThatPrintoutsAlot ; doSomethingThatPrintoutsAlot2 ; doSomethingThatPrintoutsAlot3

I can add > file, but than I would have to do it for each command and I have to use tail in another console to see the output. maybe gnome-terminal support logging everything?

there is .bash_history, so …. it might also support this.

Best Answer

The .bash_history file only stores the command history, not the output. Skimming through man bash it does not seem to support that kind of logging.

However there is the script command that is able to log the output of any terminal. The usage is quite simple:

script ~/mylog
Script started, file is /home/-----/mylog
...
(commands that produce output)
...
exit
Script done, file is /home/------/mylog

The output can be read from ~/mylog.

Related Question