Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'd like to export the content of a detached screen under linux. I tried those command:

screen -x 2>&1 > temp
screen -x > temp 2>&1
screen -x > temp

But it's not working, It keeps reattaching to a session instead of exporting it in the "temp" file.

Screen version: 4.00.03jw4

What do I do wrong?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

You probably want to do something like:

screen -p 0 -X hardcopy

this generates a file hardcopy.0 with the content of the screen session. The argument to -p determines which session.

The files are dumped in screens current working directory or to the directory set set with the hardcopydir command. Check the screen configuration file for hardcopydir (/etc/screenrc).

share|improve this answer
    
Hi, thanks for your answer! I can't find the hardcopy file. –  malabarth Dec 13 '13 at 10:21
    
it should be in the directory that you run the command in. Please check your write permissions there and post the version of screen you use (output of screen -v preferably in the question) –  Anthon Dec 13 '13 at 10:27
    
Screen version: 4.00.03jw4 I've got full r/w permission. –  malabarth Dec 13 '13 at 10:37
    
That is the same version I have, did you cut and paste the command? Run it in a different terminal than the running screen session. Any message from running the command? –  Anthon Dec 13 '13 at 10:51
    
yep, I used the same command. But there is a program running in the screen, I don't know if this change anything or not? –  malabarth Dec 13 '13 at 13:31
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.