On tty2, how do I take a text screenshot of the command line?
If you can use
screen, they have the ability to save the scrollback buffer to a file.
- Write all tmux scrollback to a file
- Copying GNU screen scrollback buffer to file (extended hardcopy)?
screendump, which is Linux-only,
screen are available for BSD-based OSes too (e.g. macOS, FreeBSD) and won't require special permissions.
You can use
script for this. It will record a typescript of the terminal session. By default, it will write to
./typescript. Of course, you need to do this in advance so it is not really a "screenshot".
$ script Script started, file is typescript $ ls asdf ls: cannot access asdf: No such file or directory $ exit Script done, file is typescript # Then check the recordings: $ cat typescript Script started on Thu 29 Nov 2018 02:52:04 PM CET $ ls asdf ls: cannot access asf: No such file or directory $ exit Script done on Thu 29 Nov 2018 02:52:09 PM CET