- 牛婧怡用户2024-11-21[[{"txt": "screen \u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u547d\u4ee4\uff0c\u63d0\u4f9b\u4ece\u5355\u4e2a SSH \u4f1a\u8bdd\u4e2d\u4f7f\u7528\u591a\u4e2a shell \u7a97\u53e3\uff08\u4f1a\u8bdd\uff09\u7684\u80fd\u529b\u3002\u5f53\u4f1a\u8bdd\u88ab\u5206\u79bb\u6216\u7f51\u7edc\u4e2d\u65ad\u65f6\uff0cscreen \u4f1a\u8bdd\u4e2d\u542f\u52a8\u7684\u8fdb\u7a0b\u4ecd\u5c06\u8fd0\u884c\uff0c\u4f60\u53ef\u4ee5\u968f\u65f6\u91cd\u65b0\u8fde\u63a5\u5230 screen \u4f1a\u8bdd\u3002\u5c06\u5c55\u793a\u5728\u00a0Linux\u00a0\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528\u00a0screen\u00a0\u7684\u57fa\u672c\u77e5\u8bc6\u3002"}], [{"txt": ["\u5de5\u5177/\u539f\u6599"]}, {"txt": " Linux \u670d\u52a1\u5668"}], [{"txt": ["\u65b9\u6cd5/\u6b65\u9aa4"]}, {"txt": "\u5982\u4f55\u5b89\u88c5 screen#screen\u5728\u4e00\u4e9b\u6d41\u884c\u7684\u53d1\u884c\u7248\u4e0a\u5df2\u7ecf\u9884\u5b89\u88c5\u4e86\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u5df2\u7ecf\u5728\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u4e86\u3002#screen -v\u00a0\u00a0 \u00a0 Screen version 4.00.03 (FAU)\u300alinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u5982\u679c\u5728 Linux \u4e2d\u8fd8\u6ca1\u6709screen\u00a0\uff0c\u4f7f\u7528\u7cfb\u7edf\u63d0\u4f9b\u7684\u5305\u7ba1\u7406\u5668\u5f88\u7b80\u5355\u5730\u5b89\u88c5\u5b83\u3002CentOS/RedHat/Fedora#yum -y install screenUbuntu/Debian#apt-get -y install screen"}, {"txt": "\u5982\u4f55\u542f\u52a8\u4e00\u4e2a screen \u4f1a\u8bdd\u4f60\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u00a0screen\u00a0\u6765\u542f\u52a8\u5b83\uff0c\u63a5\u7740\u4f1a\u6709\u4e00\u4e2a\u770b\u4e0a\u53bb\u548c\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u4e00\u6837\u7684\u00a0screen\u00a0\u4f1a\u8bdd\u542f\u52a8\u3002#screen\u4f7f\u7528\u63cf\u8ff0\u6027\u540d\u79f0\u542f\u52a8\u5c4f\u5e55\u4f1a\u8bdd\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u505a\u6cd5\uff0c\u8fd9\u6837\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u8bb0\u4f4f\u4f1a\u8bdd\u4e2d\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002\u8981\u4f7f\u7528\u4f1a\u8bdd\u540d\u79f0\u521b\u5efa\u65b0\u4f1a\u8bdd\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a#screen -S name\u5c06 \u201cname\u201d \u66ff\u6362\u4e3a\u5bf9\u4f60\u4f1a\u8bdd\u6709\u610f\u4e49\u7684\u540d\u5b57\u3002"}, {"txt": "\u4ece screen \u4f1a\u8bdd\u4e2d\u5206\u79bb\u8981\u4ece\u5f53\u524d\u7684 screen \u4f1a\u8bdd\u4e2d\u5206\u79bb\uff0c\u4f60\u53ef\u4ee5\u6309\u4e0bCtrl-A\u00a0\u548c\u00a0d\u3002\u6240\u6709\u7684 screen \u4f1a\u8bdd\u4ecd\u5c06\u662f\u6d3b\u8dc3\u7684\uff0c\u4f60\u4e4b\u540e\u53ef\u4ee5\u968f\u65f6\u91cd\u65b0\u8fde\u63a5\u3002"}, {"txt": "\u91cd\u65b0\u8fde\u63a5\u5230 screen \u4f1a\u8bdd\u5982\u679c\u4f60\u4ece\u4e00\u4e2a\u4f1a\u8bdd\u5206\u79bb\uff0c\u6216\u8005\u7531\u4e8e\u67d0\u4e9b\u539f\u56e0\u4f60\u7684\u8fde\u63a5\u88ab\u4e2d\u65ad\u4e86\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u91cd\u65b0\u8fde\u63a5\uff1a#screen -r\u5982\u679c\u4f60\u6709\u591a\u4e2a screen \u4f1a\u8bdd\uff0c\u4f60\u53ef\u4ee5\u7528\u00a0ls\u00a0\u53c2\u6570\u5217\u51fa\u5b83\u4eec\u3002#screen -ls\u00a0There are screens on:\u00a07880.session\u00a0\u00a0\u00a0 (Detached)\u00a07934.session2\u00a0\u00a0 (Detached)\u00a07907.session1\u00a0\u00a0 (Detached)\u00a03 Sockets in /var/run/screen/S-root.\u5728\u6211\u4eec\u7684\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u6709\u4e09\u4e2a\u6d3b\u8dc3\u7684 screen \u4f1a\u8bdd\u3002\u56e0\u6b64\uff0c\u5982\u679c\u4f60\u60f3\u8981\u8fd8\u539f \u201csession2\u201d \u4f1a\u8bdd\uff0c\u4f60\u53ef\u4ee5\u6267\u884c\uff1a#screen -r 7934\u6216\u8005\u4f7f\u7528 screen \u540d\u79f0\u3002#screen -r -S session2"}, {"img": ["https://exp-picture.cdn.bcebos.com/b666b2530688912c9db11b5b1b4800fc76f797d2.m2m?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1"]}, {"txt": "\u4e2d\u6b62 screen \u4f1a\u8bdd\u6709\u51e0\u79cd\u65b9\u6cd5\u6765\u4e2d\u6b62 screen \u4f1a\u8bdd\u3002\u4f60\u53ef\u4ee5\u6309\u4e0b\u00a0Ctrl+d\u00a0\uff0c\u6216\u8005\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u00a0exit\u00a0\u547d\u4ee4\u3002\u8981\u67e5\u770bscreen\u547d\u4ee4\u6240\u6709\u6709\u7528\u7684\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u67e5\u770b\u00a0screen\u00a0\u7684 man \u624b\u518c\u3002#man screen\u00a0\u00a0NAME\u00a0\u00a0 \u00a0 \u00a0 screen - screen manager with VT100/ANSI terminal emulation\u00a0\u00a0SYNOPSIS\u00a0\u00a0 \u00a0 \u00a0 screen [ -options ] [ cmd [ args ] ]\u00a0\u00a0 \u00a0 \u00a0 screen -r [[pid.]tty[.host]]\u00a0\u00a0 \u00a0 \u00a0 \u00a0screen -r sessionowner/[[pid.]tty[.host]]"}, {"img": ["https://exp-picture.cdn.bcebos.com/91091efc77f7980e615b84c2d4db3620b83a91d2.m2m?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1"]}]]1楼