To write the entire contents of the scrollback buffer to a file, type
Ctrl + A and : to get to command mode, then
hardcopy -h <filename>
In older versions of screen
, if you just do hardcopy -h
, it just writes to the file -h
. This was fixed in version 4.2.0, so hardcopy -h
writes to hardcopy.N
where N
is the current window number.
Press Ctrl+A :bufferfile /tmp/somefile.txt ENTER, and then Ctrl+A >
This will write the current contents of the buffer to the named file.
TL;DR: ^A:writebuf <filename>
The OP seems to want a way to use the selected portion of the buffer you get when doing a ^A[ , selecting text using space as the start and finish, and then instead of using ^A] to paste, save the resulting selected portion of the buffer to a file.
This worked:
^A:writebuf <filename>
Note: one 'f' in writebuf
Try hardcopy -h
to include the whole buffer.
This worked for me:
Enter edit mode (~
) and type:
:hardcopy -h buff_file
It created a huge file, of which 98% was empty, but my logs were fully present in remaining 2%.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With