Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个脚本在分离的屏幕上在后台运行,但不写入日志文件。( screen -dmS somename somescript)
screen -dmS somename somescript
当我检查脚本时,我附加到它(screen -r somename),然后在我完成时分离(C-a d)。
screen -r somename
C-a d
与其连接然后分离,是否可以简单地“偷看”屏幕上的内容? 类似的东西echo "$(screen -r somename)"真的有效吗?
echo "$(screen -r somename)"
该-X选项将命令发送到正在运行的屏幕实例:
-X
screen -r somename -X hardcopy
该hardcopy命令将屏幕转储写入hardcopy.N,其中N是活动屏幕的索引。
hardcopy
hardcopy.N
N