0

Is it possible to capture all messages from current terminal session and write them to a file ?

  • I don't mean capturing command output or monitor any further messages using >>, script or tee.
  • What I mean is literally dumping to a file what is already on screen
  • I totally dont mean selecting anything by mouse and copying to clipboard
rezoner
  • 1,907
  • 13
  • 16

1 Answers1

1

You can dump the contents of virtual consoles using setterm's -append or -dump flags and the TTY #:

setterm -append 3

will append contents from the VCS TTY 3 to the file screen.dump.

Otherwise, you may need to use something like screen, which allows you to dump what's in the scrollback buffer to a file.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220