I open lxterminal, which shows up in ps
output as x-terminal-emulator. I then enter a command which prints it's output to STDOUT, which is visible on my screen. The command finishes, and I am shown another prompt.
The output of the previous command is still visible, so I can copy and paste it by GUI text selection, but I would like to be able to access it from a script.
Options for accessing this output that I can imagine:
- Is it stored somewhere, like in
/dev
? - Is it in memory somewhere that I could read with low-level tools?
- Can I script my terminal emulator to store the output of every command while still outputting it normally?
- Is there a tool to scrape text from GTK windows that could access the full terminal window contents?
gdb
to any processs and read its memory. 3. script(1), tee(1). 4. noscript
command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.