{"id":66,"date":"2026-04-16T21:57:32","date_gmt":"2026-04-16T13:57:32","guid":{"rendered":"https:\/\/www.bojinhu.xyz\/?p=66"},"modified":"2026-04-22T12:18:31","modified_gmt":"2026-04-22T04:18:31","slug":"tmux-%e7%bb%88%e7%ab%af%e5%a4%8d%e7%94%a8%e5%99%a8%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.bojinhu.xyz\/index.php\/2026\/04\/16\/tmux-%e7%bb%88%e7%ab%af%e5%a4%8d%e7%94%a8%e5%99%a8%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0\/","title":{"rendered":"Tmux \u7ec8\u7aef\u590d\u7528\u5668\u5b66\u4e60\u7b14\u8bb0"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u4e00\u3001Tmux \u662f\u4ec0\u4e48\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tmux\uff08Terminal Multiplexer\uff09\u662f\u4e00\u4e2a\u7ec8\u7aef\u590d\u7528\u5de5\u5177\uff0c\u6838\u5fc3\u4f5c\u7528\u662f\u5728\u4e00\u4e2a\u7ec8\u7aef\u7a97\u53e3\u91cc\u7ba1\u7406\u591a\u4e2a\u4f1a\u8bdd\uff08Session\uff09\u3001\u7a97\u53e3\uff08Window\uff09\u548c\u7a97\u683c\uff08Pane\uff09\u3002\u6211\u4e2a\u4eba\u7406\u89e3\uff0c\u5b83\u672c\u8d28\u4e0a\u662f\u7ed9 SSH \u4f1a\u8bdd\u5957\u4e86\u4e00\u5c42\u201c\u5bb9\u5668\u201d\u2014\u2014tmux \u672c\u8eab\u662f\u5b88\u62a4\u8fdb\u7a0b\uff0c\u91cc\u9762\u7684\u5b50\u8fdb\u7a0b\u4e0d\u4f9d\u8d56\u4e8e\u672c\u5730\u7ec8\u7aef\u662f\u5426\u5b58\u6d3b\uff0c\u6240\u4ee5\u5373\u4f7f\u5173\u95ed\u7ec8\u7aef\u6216\u7f51\u7edc\u65ad\u5f00\uff0c\u4efb\u52a1\u4e5f\u4e0d\u4f1a\u4e2d\u65ad\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u7ecf\u5e38\u9700\u8981 SSH \u8fde\u670d\u52a1\u5668\u7684\u4eba\u6765\u8bf4\uff0ctmux \u89e3\u51b3\u4e86\u4e24\u4e2a\u75db\u70b9\uff1a\u4e00\u662f\u7f51\u7edc\u65ad\u4e86\u91cd\u8fde\u540e\u53ef\u4ee5<strong>\u6062\u590d\u4e4b\u524d\u7684\u5de5\u4f5c\u72b6\u6001<\/strong>\uff0c\u4e8c\u662f\u53ef\u4ee5\u5728\u540c\u4e00\u7a97\u53e3\u91cc<strong>\u540c\u65f6\u8dd1\u591a\u4e2a\u4efb\u52a1<\/strong>\uff08\u6bd4\u5982\u4e00\u8fb9\u7f16\u8f91\u4ee3\u7801\u4e00\u8fb9\u770b\u65e5\u5fd7\uff09\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e8c\u3001\u5b89\u88c5<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7cfb\u7edf<\/th><th>\u547d\u4ee4<\/th><\/tr><\/thead><tbody><tr><td>Ubuntu\/Debian<\/td><td><code>sudo apt install tmux<\/code><\/td><\/tr><tr><td>Arch Linux<\/td><td><code>sudo pacman -S tmux<\/code><\/td><\/tr><tr><td>macOS<\/td><td><code>brew install tmux<\/code><\/td><\/tr><tr><td>CentOS\/RHEL<\/td><td><code>sudo yum install tmux<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u540e\u7528 <code>tmux -V<\/code> \u786e\u8ba4\u7248\u672c\u5373\u53ef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e09\u3001\u6838\u5fc3\u6982\u5ff5\uff08\u4e09\u5c42\u5c42\u7ea7\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tmux \u7684\u7ec4\u7ec7\u7ed3\u6784\u53ef\u4ee5\u7406\u89e3\u4e3a\u4e09\u5c42\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f1a\u8bdd\uff08Session\uff09<\/strong>\uff1a\u6700\u9876\u5c42\uff0c\u4e00\u4e2a\u4f1a\u8bdd\u5c31\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u5de5\u4f5c\u7a7a\u95f4\uff0c\u53ef\u4ee5\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\u3002\u7ed9\u4f1a\u8bdd\u8d77\u540d\u5b57\u975e\u5e38\u91cd\u8981\uff0c\u5426\u5219\u65f6\u95f4\u4e00\u957f\u5c31\u5fd8\u4e86 0 \u53f7\u30011 \u53f7\u4f1a\u8bdd\u5bf9\u5e94\u4ec0\u4e48\u4efb\u52a1\u4e86\u3002<\/li>\n\n\n\n<li><strong>\u7a97\u53e3\uff08Window\uff09<\/strong>\uff1a\u4f1a\u8bdd\u91cc\u9762\u7684\u201c\u6807\u7b7e\u9875\u201d\uff0c\u6bcf\u4e2a\u7a97\u53e3\u5360\u636e\u6574\u4e2a\u5c4f\u5e55\u3002<\/li>\n\n\n\n<li><strong>\u7a97\u683c\uff08Pane\uff09<\/strong>\uff1a\u7a97\u53e3\u53ef\u4ee5\u5206\u5272\u6210\u591a\u4e2a\u5c0f\u533a\u57df\uff0c\u6bcf\u4e2a\u533a\u57df\u72ec\u7acb\u8fd0\u884c\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u4e09\u5c42\u5c42\u7ea7\u7ed3\u6784\u7684\u597d\u5904\u662f\uff1a\u6bcf\u4e2a\u4f1a\u8bdd\u53ef\u4ee5\u5bf9\u5e94\u4e00\u4e2a\u9879\u76ee\uff08\u6bd4\u5982 <code>blog<\/code>\u3001<code>leetcode<\/code>\uff09\uff0c\u4f1a\u8bdd\u91cc\u7684\u4e0d\u540c\u7a97\u53e3\u53ef\u4ee5\u5bf9\u5e94\u4e0d\u540c\u7684\u529f\u80fd\u6a21\u5757\uff0c\u7a97\u683c\u5219\u7528\u6765\u540c\u65f6\u67e5\u770b\u591a\u4e2a\u8f93\u51fa\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u56db\u3001\u5e38\u7528\u547d\u4ee4\u901f\u8bb0<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u4f1a\u8bdd\u7ba1\u7406<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u64cd\u4f5c<\/th><th>\u547d\u4ee4<\/th><th>\u5feb\u6377\u952e<\/th><\/tr><\/thead><tbody><tr><td>\u65b0\u5efa\u4f1a\u8bdd\uff08\u547d\u540d\uff09<\/td><td><code>tmux new -s \u4f1a\u8bdd\u540d<\/code><\/td><td>\u2014<\/td><\/tr><tr><td>\u65b0\u5efa\u4f1a\u8bdd\uff08\u4e0d\u547d\u540d\uff09<\/td><td><code>tmux<\/code><\/td><td>\u2014<\/td><\/tr><tr><td>\u5206\u79bb\u4f1a\u8bdd\uff08\u540e\u53f0\u8fd0\u884c\uff09<\/td><td><code>tmux detach<\/code><\/td><td><code>Ctrl+b d<\/code><\/td><\/tr><tr><td>\u67e5\u770b\u6240\u6709\u4f1a\u8bdd<\/td><td><code>tmux ls<\/code><\/td><td><code>Ctrl+b s<\/code><\/td><\/tr><tr><td>\u8fde\u63a5\u4f1a\u8bdd<\/td><td><code>tmux attach -t \u4f1a\u8bdd\u540d<\/code><\/td><td>\u2014<\/td><\/tr><tr><td>\u91cd\u547d\u540d\u5f53\u524d\u4f1a\u8bdd<\/td><td><code>tmux rename-session<\/code><\/td><td><code>Ctrl+b $<\/code><\/td><\/tr><tr><td>\u6740\u6b7b\u4f1a\u8bdd<\/td><td><code>tmux kill-session -t \u4f1a\u8bdd\u540d<\/code><\/td><td>\u2014<\/td><\/tr><tr><td>\u6740\u6b7b\u6240\u6709\u4f1a\u8bdd<\/td><td><code>tmux kill-server<\/code><\/td><td>\u2014<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u5efa\u4f1a\u8bdd\u65f6\u4e00\u5b9a\u8981\u7528 <code>-s<\/code> \u8d77\u540d\u5b57\uff0c\u8fd9\u6837\u4ee5\u540e\u7528 <code>tmux attach -t \u540d\u5b57<\/code> \u5c31\u80fd\u76f4\u63a5\u6062\u590d\uff0c\u4e0d\u9700\u8981\u5148\u67e5\u7f16\u53f7\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u7a97\u53e3\u7ba1\u7406<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u64cd\u4f5c<\/th><th>\u5feb\u6377\u952e<\/th><\/tr><\/thead><tbody><tr><td>\u521b\u5efa\u65b0\u7a97\u53e3<\/td><td><code>Ctrl+b c<\/code><\/td><\/tr><tr><td>\u5207\u6362\u5230\u4e0b\u4e00\u4e2a\u7a97\u53e3<\/td><td><code>Ctrl+b n<\/code><\/td><\/tr><tr><td>\u5207\u6362\u5230\u4e0a\u4e00\u4e2a\u7a97\u53e3<\/td><td><code>Ctrl+b p<\/code><\/td><\/tr><tr><td>\u5207\u6362\u5230\u6307\u5b9a\u7f16\u53f7\u7a97\u53e3\uff080-9\uff09<\/td><td><code>Ctrl+b \u6570\u5b57<\/code><\/td><\/tr><tr><td>\u5207\u6362\u5230\u4e0a\u4e00\u4e2a\u6fc0\u6d3b\u7684\u7a97\u53e3<\/td><td><code>Ctrl+b l<\/code><\/td><\/tr><tr><td>\u5217\u51fa\u6240\u6709\u7a97\u53e3<\/td><td><code>Ctrl+b w<\/code><\/td><\/tr><tr><td>\u91cd\u547d\u540d\u5f53\u524d\u7a97\u53e3<\/td><td><code>Ctrl+b ,<\/code><\/td><\/tr><tr><td>\u5173\u95ed\u5f53\u524d\u7a97\u53e3<\/td><td><code>Ctrl+b &amp;<\/code> \u6216 <code>exit<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u5c0f\u6280\u5de7<\/strong>\uff1a\u7528 <code>Ctrl+b w<\/code> \u53ef\u4ee5\u5217\u51fa\u6240\u6709\u7a97\u53e3\u5e76\u4ea4\u4e92\u5f0f\u9009\u62e9\uff0c\u6bd4\u4e00\u4e2a\u4e2a\u7ffb\u9875\u5feb\u591a\u4e86\u3002<\/p>\n<\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\">3. \u7a97\u683c\uff08Pane\uff09\u64cd\u4f5c<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u64cd\u4f5c<\/th><th>\u5feb\u6377\u952e<\/th><\/tr><\/thead><tbody><tr><td>\u5782\u76f4\u5206\u5272\uff08\u5de6\u53f3\u5206\u5c4f\uff09<\/td><td><code>Ctrl+b %<\/code><\/td><\/tr><tr><td>\u6c34\u5e73\u5206\u5272\uff08\u4e0a\u4e0b\u5206\u5c4f\uff09<\/td><td><code>Ctrl+b \"<\/code><\/td><\/tr><tr><td>\u5149\u6807\u5207\u6362\u5230\u5176\u4ed6\u7a97\u683c<\/td><td><code>Ctrl+b \u65b9\u5411\u952e<\/code><\/td><\/tr><tr><td>\u5149\u6807\u5207\u6362\u5230\u4e0b\u4e00\u4e2a\u7a97\u683c<\/td><td><code>Ctrl+b o<\/code><\/td><\/tr><tr><td>\u663e\u793a\u7a97\u683c\u7f16\u53f7<\/td><td><code>Ctrl+b q<\/code>\uff08\u7f16\u53f7\u6d88\u5931\u524d\u6309\u6570\u5b57\u8df3\u8f6c\uff09<\/td><\/tr><tr><td>\u5f53\u524d\u7a97\u683c\u7f29\u653e\u81f3\u5168\u5c4f\/\u6062\u590d<\/td><td><code>Ctrl+b z<\/code><\/td><\/tr><tr><td>\u5173\u95ed\u5f53\u524d\u7a97\u683c<\/td><td><code>Ctrl+b x<\/code><\/td><\/tr><tr><td>\u5f53\u524d\u7a97\u683c\u62c6\u5206\u4e3a\u72ec\u7acb\u7a97\u53e3<\/td><td><code>Ctrl+b !<\/code><\/td><\/tr><tr><td>\u4ea4\u6362\u5f53\u524d\u7a97\u683c\u4e0e\u524d\u4e00\u4e2a<\/td><td><code>Ctrl+b {<\/code><\/td><\/tr><tr><td>\u4ea4\u6362\u5f53\u524d\u7a97\u683c\u4e0e\u540e\u4e00\u4e2a<\/td><td><code>Ctrl+b }<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5206\u5272\u7a97\u53e3\u662f tmux \u6700\u5e38\u7528\u7684\u529f\u80fd\u4e4b\u4e00\u3002\u5782\u76f4\u5206\u5272\u7528 <code>%<\/code>\uff0c\u6c34\u5e73\u5206\u5272\u7528 <code>\"<\/code>\uff0c\u8fd9\u4e24\u4e2a\u7b26\u53f7\u9700\u8981\u8bb0\u4e00\u4e0b\u3002\u5206\u5272\u540e\u5efa\u8bae\u7acb\u5373\u7528 <code>Ctrl+b z<\/code> \u628a\u67d0\u4e2a\u7a97\u683c\u4e34\u65f6\u653e\u5927\u4e13\u5fc3\u64cd\u4f5c\uff0c\u5f04\u5b8c\u518d\u6309\u4e00\u6b21\u6062\u590d\u5e03\u5c40\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8c03\u6574\u7a97\u683c\u5927\u5c0f<\/strong>\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u64cd\u4f5c<\/th><th>\u5feb\u6377\u952e<\/th><\/tr><\/thead><tbody><tr><td>\u6309 1 \u4e2a\u5355\u5143\u683c\u8c03\u6574<\/td><td><code>Ctrl+b Ctrl+\u65b9\u5411\u952e<\/code><\/td><\/tr><tr><td>\u6309 5 \u4e2a\u5355\u5143\u683c\u8c03\u6574<\/td><td><code>Ctrl+b Alt+\u65b9\u5411\u952e<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Ctrl+b q<\/code> \u663e\u793a\u7f16\u53f7\u540e\uff0c\u6309\u5bf9\u5e94\u6570\u5b57\u53ef\u4ee5\u77ac\u95f4\u8df3\u8f6c\u5230\u76ee\u6807\u7a97\u683c\uff0c\u5728\u7a97\u683c\u6570\u91cf\u591a\u7684\u65f6\u5019\u975e\u5e38\u5b9e\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e94\u3001\u590d\u5236\u6a21\u5f0f\u4e0e\u6eda\u52a8<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ctmux \u91cc\u4e0d\u80fd\u7528\u9f20\u6807\u6eda\u8f6e\u6eda\u52a8\u5386\u53f2\u8f93\u51fa\uff0c\u9700\u8981\u7528\u590d\u5236\u6a21\u5f0f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fdb\u5165\u590d\u5236\u6a21\u5f0f\uff1a<code>Ctrl+b [<\/code><br>\u9000\u51fa\u590d\u5236\u6a21\u5f0f\uff1a<code>q<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fdb\u5165\u590d\u5236\u6a21\u5f0f\u540e\u7684\u5e38\u7528\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u64cd\u4f5c<\/th><th>\u5feb\u6377\u952e<\/th><\/tr><\/thead><tbody><tr><td>\u5411\u4e0a\u6eda\u52a8\u4e00\u884c<\/td><td><code>\u2191<\/code> \u6216 <code>k<\/code><\/td><\/tr><tr><td>\u5411\u4e0b\u6eda\u52a8\u4e00\u884c<\/td><td><code>\u2193<\/code> \u6216 <code>j<\/code><\/td><\/tr><tr><td>\u5411\u4e0a\u7ffb\u9875<\/td><td><code>PageUp<\/code> \u6216 <code>Ctrl+b<\/code><\/td><\/tr><tr><td>\u5411\u4e0b\u7ffb\u9875<\/td><td><code>PageDown<\/code> \u6216 <code>Ctrl+f<\/code><\/td><\/tr><tr><td>\u5f00\u59cb\u9009\u62e9\u6587\u672c<\/td><td><code>\u7a7a\u683c\u952e<\/code><\/td><\/tr><tr><td>\u590d\u5236\u9009\u4e2d\u5185\u5bb9<\/td><td><code>\u56de\u8f66\u952e<\/code><\/td><\/tr><tr><td>\u7c98\u8d34<\/td><td><code>Ctrl+b ]<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u60f3\u8981<strong>\u9f20\u6807\u6eda\u8f6e\u76f4\u63a5\u6eda\u52a8<\/strong>\uff0c\u9700\u8981\u5728 <code>~\/.tmux.conf<\/code> \u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u884c\uff1a<code>set -g mouse on<\/code>\uff0c\u7136\u540e\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u5373\u53ef\u3002\u8fd9\u6837\u5c31\u80fd\u7528\u9f20\u6807\u6eda\u8f6e\u6eda\u52a8\u5386\u53f2\u8f93\u51fa\u4e86\uff0c\u4f53\u9a8c\u4f1a\u597d\u5f88\u591a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u516d\u3001\u914d\u7f6e\u6587\u4ef6\uff08~\/.tmux.conf\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e2a\u4eba\u914d\u7f6e\u5728 <code>~\/.tmux.conf<\/code>\uff0c\u6539\u52a8\u540e\u9700\u8981 <code>tmux source-file ~\/.tmux.conf<\/code> \u91cd\u65b0\u52a0\u8f7d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u662f\u6211\u81ea\u5df1\u7528\u7684\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n# \u542f\u7528\u9f20\u6807\u652f\u6301\uff08\u6eda\u52a8 + \u9009\u62e9\u7a97\u683c\uff09\nset -g mouse on\n\n# \u8bbe\u7f6e\u5386\u53f2\u7f13\u51b2\u533a\u5927\u5c0f\nset -g history-limit 10000\n\n# \u8bbe\u7f6e\u72b6\u6001\u680f\u6837\u5f0f\nset -g status-bg black\nset -g status-fg white\nset -g status-left \"#&#91;fg=green]#S#&#91;default]\"\nset -g status-right \"#&#91;fg=yellow] %Y-%m-%d %H:%M #&#91;default]\"\n\n# \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u7684\u5feb\u6377\u952e\nbind r source-file ~\/.tmux.conf \\; display \"Reloaded!\"\n\n# \u4f7f\u7528 vi \u98ce\u683c\u7684\u590d\u5236\u6a21\u5f0f\u952e\u4f4d\uff08\u4e0e vim \u4fdd\u6301\u4e00\u81f4\uff09\nsetw -g mode-keys vi\n\n# \u5feb\u901f\u5206\u5c4f\uff08\u65b9\u4fbf\u8bb0\u5fc6\uff09\nbind | split-window -h\nbind - split-window -v\n\n# \u4f7f\u7528 hjkl \u79fb\u52a8\u7a97\u683c\uff08vim \u7528\u6237\u798f\u97f3\uff09\nbind h select-pane -L\nbind j select-pane -D\nbind k select-pane -U\nbind l select-pane -R<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u914d\u7f6e\u8bf4\u660e<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Ctrl+a r<\/code> \u7528\u6765\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\uff0c\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\u65f6\u5f88\u65b9\u4fbf\u3002<\/li>\n\n\n\n<li>\u7528 <code>|<\/code> \u548c <code>-<\/code> \u4ee3\u66ff <code>%<\/code> \u548c <code>\"<\/code> \u505a\u5206\u5c4f\uff0c\u89c6\u89c9\u4e0a\u66f4\u76f4\u89c2\uff08\u7ad6\u7ebf=\u5782\u76f4\u5206\u5c4f\uff0c\u6a2a\u7ebf=\u6c34\u5e73\u5206\u5c4f\uff09\u3002<\/li>\n\n\n\n<li>\u7528 <code>hjkl<\/code> \u79fb\u52a8\u7a97\u683c\uff0c\u5bf9\u4e60\u60ef vim \u952e\u4f4d\u7684\u4eba\u6765\u8bf4\u4e0d\u7528\u91cd\u65b0\u9002\u5e94\u3002<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e03\u3001\u9ad8\u9891\u7528\u6cd5\u573a\u666f<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u573a\u666f 1\uff1aSSH \u8fdc\u7a0b\u5de5\u4f5c<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fde\u4e0a\u670d\u52a1\u5668\u540e\u7684\u6807\u51c6\u6d41\u7a0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7b2c\u4e00\u6b65\uff0c\u521b\u5efa\u547d\u540d\u4f1a\u8bdd\ntmux new -s myserver\n\n# \u6b63\u5e38\u5e72\u6d3b...\n\n# \u4e34\u65f6\u8981\u65ad\u5f00\uff0c\u5206\u79bb\u4f1a\u8bdd\nCtrl+b d\n\n# \u4e0b\u6b21\u91cd\u65b0\u8fde\uff0c\u6062\u590d\ntmux attach -t myserver<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u65e5\u5e38\u5de5\u4f5c\u5fc5\u987b\uff1a\u8fde\u4e0a\u670d\u52a1\u5668\u540e\u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u521b\u5efa tmux \u4f1a\u8bdd\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u8dd1\u547d\u4ee4\u3002\u65ad\u7ebf\u91cd\u8fde\u540e\u7528 <code>tmux ls<\/code> \u67e5\u770b\u4f1a\u8bdd\uff0c\u518d\u7528 <code>tmux attach -t xxx<\/code> \u6062\u590d\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u5f00 shell\u3002<\/p>\n<\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\">\u573a\u666f 2\uff1a\u540c\u65f6\u7f16\u8f91\u548c\u8fd0\u884c<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4e00\u4e2a\u7a97\u53e3\u91cc\u5782\u76f4\u5206\u5272\u6210\u4e24\u4e2a\u7a97\u683c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Ctrl+b %   # \u5de6\u53f3\u5206\u5c4f\n\u5de6\u8fb9\u7528 vim \u7f16\u8f91\u4ee3\u7801\uff0c\u53f3\u8fb9\u8fd0\u884c\u7a0b\u5e8f\uff0c\u4fee\u6539\u540e\u7acb\u5373\u6d4b\u8bd5\u3002<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u573a\u666f 3\uff1a\u76d1\u63a7\u591a\u4e2a\u670d\u52a1<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u7a97\u53e3 1\uff1a\u8dd1 web \u670d\u52a1<br>\u7a97\u53e3 2\uff1a\u8dd1\u6570\u636e\u5e93<br>\u7a97\u53e3 3\uff1a\u8dd1\u65e5\u5fd7\u76d1\u63a7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7a97\u53e3\u4e4b\u95f4\u7528 <code>Ctrl+b n<\/code> \/ <code>Ctrl+b p<\/code> \u5207\u6362\uff0c\u6bcf\u4e2a\u7a97\u53e3\u5185\u90e8\u8fd8\u53ef\u4ee5\u7ee7\u7eed\u5206\u5272\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u573a\u666f 4\uff1a\u957f\u65f6\u95f4\u4efb\u52a1\uff08\u6570\u636e\u8bad\u7ec3\/\u6a21\u578b\u8dd1\u6279\uff09<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux new -s training\n# \u542f\u52a8\u8bad\u7ec3\u811a\u672c\npython train.py\nCtrl+b d  # \u5206\u79bb\u4f1a\u8bdd\uff0c\u5173\u95ed\u7ec8\u7aef\n# \u7b2c\u4e8c\u5929\u56de\u6765\ntmux attach -t training  # \u4efb\u52a1\u8fd8\u5728\u8dd1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6bd4 <code>nohup<\/code> \u597d\u591a\u4e86\uff0c\u56e0\u4e3a <code>nohup<\/code> \u53ea\u80fd\u8ba9\u4efb\u52a1\u5728\u540e\u53f0\u7ee7\u7eed\u8dd1\uff0c\u4f46\u65e0\u6cd5\u91cd\u65b0\u8fde\u63a5\u5230\u4efb\u52a1\u754c\u9762\uff0c\u800c tmux \u53ef\u4ee5\u968f\u65f6\u6062\u590d\u5e76\u67e5\u770b\u5b9e\u65f6\u8f93\u51fa\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001Tmux \u662f\u4ec0\u4e48\uff1f Tmux\uff08Terminal Multiplexer\uff09\u662f\u4e00\u4e2a\u7ec8\u7aef\u590d\u7528\u5de5\u5177\uff0c\u6838\u5fc3\u4f5c\u7528\u662f\u5728\u4e00 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":67,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[20,22,21],"class_list":["post-66","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mtsb","tag-tmux","tag-22"],"_links":{"self":[{"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":1,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":68,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/posts\/66\/revisions\/68"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/media\/67"}],"wp:attachment":[{"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bojinhu.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}