Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 4649  / 1 Year ago, fri, february 3, 2023, 2:49:29

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.


More From » gnome

 Answers
5

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.


[#41784] Saturday, February 4, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sipwing

Total Points: 245
Total Questions: 100
Total Answers: 118

Location: Aland Islands
Member since Thu, Oct 22, 2020
4 Years ago
sipwing questions
Sun, May 29, 22, 22:00, 2 Years ago
Fri, Jun 24, 22, 08:46, 2 Years ago
Fri, Dec 23, 22, 00:04, 1 Year ago
;