9

I have run a specific program in a bash terminal and I closed it by mistake before reading its output. Is it possible to recover the information that was sent to the stdout by taking a look at some sort of bash stdout history log?

Thank you so much.

5
  • Depending on the configuration of the program you are using, there may be a log with the output.
    – fedorqui
    May 21, 2013 at 14:33
  • It's a program that I wrote myself, so I know that I'm not logging anything. (Unless Python generates an automatic log... does that exist at all?)
    – urinieto
    May 21, 2013 at 14:35
  • Well I refer to the terminal you are using. For example, PuTTY normally saves logs.
    – fedorqui
    May 21, 2013 at 14:39
  • This would be a feature of the terminal-emulator (e.g. xterm, gnome-terminal, etc.) because the shell quite literally has no idea what the program sent to stdout. I've not known a common terminal program that logs by default, so you're probably out of luck.
    – msw
    May 21, 2013 at 14:39
  • Thank you so much for your answers. I am using Terminal.app of OSX. Unfortunately, I haven't found any feature like that...
    – urinieto
    May 21, 2013 at 14:43

2 Answers 2

10

No, there isn't STDOUT history on the filesystem.

If you don't have logging enabled for your terminal then you are out of luck.

1

If you work with a script log then it records everything in that .....

Next time run this at your home directory: script -a yoursession.log That would record all the commands and what ever output you get while you work into the log file.

Man page script command description:

Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .