Command Line – How to Save Existing Command Line Text on Screen to a File

command linetext;

On tty2, how do I take a text screenshot of the command line?

Best Answer

If you can use tmux or screen, they have the ability to save the scrollback buffer to a file.

Unlike screendump, which is Linux-only, tmux and screen are available for BSD-based OSes too (e.g. macOS, FreeBSD) and won't require special permissions.

Related Question