I have a script that runs in the background on a detached screen but doesn't write to a log file. (screen -dmS somename somescript
)
When I check on the script, I attach to it (screen -r somename
) then detach when I'm done (C-a d
).
Instead of attaching then detaching, is it possible to simply "peek" at what's on the screen?
Something similar to echo "$(screen -r somename)"
that actually works?
The -X
option sends a command to a running screen instance:
screen -r somename -X hardcopy
the hardcopy
command writes a screen dump into hardcopy.N
, where N
is the index of the active screen.
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