﻿{"id":791,"date":"2021-01-02T06:45:29","date_gmt":"2021-01-01T22:45:29","guid":{"rendered":"https:\/\/byy3.com\/?p=791"},"modified":"2021-02-08T19:00:53","modified_gmt":"2021-02-08T11:00:53","slug":"tmux-%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=791","title":{"rendered":"Tmux \u4f7f\u7528\u6559\u7a0b"},"content":{"rendered":"<p>Tmux \u662f\u4e00\u4e2a\u7ec8\u7aef\u590d\u7528\u5668\uff08terminal multiplexer\uff09\uff0c\u975e\u5e38\u6709\u7528\uff0c\u5c5e\u4e8e\u5e38\u7528\u7684\u5f00\u53d1\u5de5\u5177\u3002<\/p>\n<p>\u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Tmux\u3002<\/p>\n<p><img decoding=\"async\" data-original=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201910\/bg2019102005.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"Tmux \u4f7f\u7528\u6559\u7a0b\u63d2\u56fe\" alt=\"Tmux \u4f7f\u7528\u6559\u7a0b\u63d2\u56fe\" \/><\/p>\n<h2>\u4e00\u3001Tmux \u662f\u4ec0\u4e48\uff1f<\/h2>\n<h3>1.1 \u4f1a\u8bdd\u4e0e\u8fdb\u7a0b<\/h3>\n<p>\u547d\u4ee4\u884c\u7684\u5178\u578b\u4f7f\u7528\u65b9\u5f0f\u662f\uff0c\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\u7a97\u53e3\uff08terminal window\uff0c\u4ee5\u4e0b\u7b80\u79f0&quot;\u7a97\u53e3&quot;\uff09\uff0c\u5728\u91cc\u9762\u8f93\u5165\u547d\u4ee4\u3002<strong>\u7528\u6237\u4e0e\u8ba1\u7b97\u673a\u7684\u8fd9\u79cd\u4e34\u65f6\u7684\u4ea4\u4e92\uff0c\u79f0\u4e3a\u4e00\u6b21&quot;\u4f1a\u8bdd&quot;\uff08session\uff09<\/strong>\u00a0\u3002<\/p>\n<p>\u4f1a\u8bdd\u7684\u4e00\u4e2a\u91cd\u8981\u7279\u70b9\u662f\uff0c\u7a97\u53e3\u4e0e\u5176\u4e2d\u542f\u52a8\u7684\u8fdb\u7a0b\u662f<a href=\"https:\/\/byy3.com\/go\/?url=http:\/\/www.ruanyifeng.com\/blog\/2016\/02\/linux-daemon.html\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >\u8fde\u5728\u4e00\u8d77<\/a>\u7684\u3002\u6253\u5f00\u7a97\u53e3\uff0c\u4f1a\u8bdd\u5f00\u59cb\uff1b\u5173\u95ed\u7a97\u53e3\uff0c\u4f1a\u8bdd\u7ed3\u675f\uff0c\u4f1a\u8bdd\u5185\u90e8\u7684\u8fdb\u7a0b\u4e5f\u4f1a\u968f\u4e4b\u7ec8\u6b62\uff0c\u4e0d\u7ba1\u6709\u6ca1\u6709\u8fd0\u884c\u5b8c\u3002<\/p>\n<p>\u4e00\u4e2a\u5178\u578b\u7684\u4f8b\u5b50\u5c31\u662f\uff0c<a href=\"https:\/\/byy3.com\/go\/?url=http:\/\/www.ruanyifeng.com\/blog\/2011\/12\/ssh_remote_login.html\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >SSH \u767b\u5f55<\/a>\u8fdc\u7a0b\u8ba1\u7b97\u673a\uff0c\u6253\u5f00\u4e00\u4e2a\u8fdc\u7a0b\u7a97\u53e3\u6267\u884c\u547d\u4ee4\u3002\u8fd9\u65f6\uff0c\u7f51\u7edc\u7a81\u7136\u65ad\u7ebf\uff0c\u518d\u6b21\u767b\u5f55\u7684\u65f6\u5019\uff0c\u662f\u627e\u4e0d\u56de\u4e0a\u4e00\u6b21\u6267\u884c\u7684\u547d\u4ee4\u7684\u3002\u56e0\u4e3a\u4e0a\u4e00\u6b21 SSH \u4f1a\u8bdd\u5df2\u7ecf\u7ec8\u6b62\u4e86\uff0c\u91cc\u9762\u7684\u8fdb\u7a0b\u4e5f\u968f\u4e4b\u6d88\u5931\u4e86\u3002<\/p>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4f1a\u8bdd\u4e0e\u7a97\u53e3\u53ef\u4ee5&quot;\u89e3\u7ed1&quot;\uff1a\u7a97\u53e3\u5173\u95ed\u65f6\uff0c\u4f1a\u8bdd\u5e76\u4e0d\u7ec8\u6b62\uff0c\u800c\u662f\u7ee7\u7eed\u8fd0\u884c\uff0c\u7b49\u5230\u4ee5\u540e\u9700\u8981\u7684\u65f6\u5019\uff0c\u518d\u8ba9\u4f1a\u8bdd&quot;\u7ed1\u5b9a&quot;\u5176\u4ed6\u7a97\u53e3\u3002<\/p>\n<h3>1.2 Tmux \u7684\u4f5c\u7528<\/h3>\n<p><strong>Tmux \u5c31\u662f\u4f1a\u8bdd\u4e0e\u7a97\u53e3\u7684&quot;\u89e3\u7ed1&quot;\u5de5\u5177\uff0c\u5c06\u5b83\u4eec\u5f7b\u5e95\u5206\u79bb\u3002<\/strong><\/p>\n<blockquote><p>\uff081\uff09\u5b83\u5141\u8bb8\u5728\u5355\u4e2a\u7a97\u53e3\u4e2d\uff0c\u540c\u65f6\u8bbf\u95ee\u591a\u4e2a\u4f1a\u8bdd\u3002\u8fd9\u5bf9\u4e8e\u540c\u65f6\u8fd0\u884c\u591a\u4e2a\u547d\u4ee4\u884c\u7a0b\u5e8f\u5f88\u6709\u7528\u3002<\/p>\n<p>\uff082\uff09 \u5b83\u53ef\u4ee5\u8ba9\u65b0\u7a97\u53e3\"\u63a5\u5165\"\u5df2\u7ecf\u5b58\u5728\u7684\u4f1a\u8bdd\u3002<\/p>\n<p>\uff083\uff09\u5b83\u5141\u8bb8\u6bcf\u4e2a\u4f1a\u8bdd\u6709\u591a\u4e2a\u8fde\u63a5\u7a97\u53e3\uff0c\u56e0\u6b64\u53ef\u4ee5\u591a\u4eba\u5b9e\u65f6\u5171\u4eab\u4f1a\u8bdd\u3002<\/p>\n<p>\uff084\uff09\u5b83\u8fd8\u652f\u6301\u7a97\u53e3\u4efb\u610f\u7684\u5782\u76f4\u548c\u6c34\u5e73\u62c6\u5206\u3002<\/p><\/blockquote>\n<p>\u7c7b\u4f3c\u7684\u7ec8\u7aef\u590d\u7528\u5668\u8fd8\u6709 GNU Screen\u3002Tmux \u4e0e\u5b83\u529f\u80fd\u76f8\u4f3c\uff0c\u4f46\u662f\u66f4\u6613\u7528\uff0c\u4e5f\u66f4\u5f3a\u5927\u3002<\/p>\n<h2>\u4e8c\u3001\u57fa\u672c\u7528\u6cd5<\/h2>\n<h3>2.1 \u5b89\u88c5<\/h3>\n<p>Tmux \u4e00\u822c\u9700\u8981\u81ea\u5df1\u5b89\u88c5\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# Ubuntu \u6216 Debian\n$ sudo apt-get install tmux\n\n# CentOS \u6216 Fedora\n$ sudo yum install tmux\n\n# Mac\n$ brew install tmux\n<\/code><\/pre>\n<\/blockquote>\n<h3>2.2 \u542f\u52a8\u4e0e\u9000\u51fa<\/h3>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u952e\u5165<code>tmux<\/code>\u547d\u4ee4\uff0c\u5c31\u8fdb\u5165\u4e86 Tmux \u7a97\u53e3\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux\n<\/code><\/pre>\n<\/blockquote>\n<p>\u4e0a\u9762\u547d\u4ee4\u4f1a\u542f\u52a8 Tmux \u7a97\u53e3\uff0c\u5e95\u90e8\u6709\u4e00\u4e2a\u72b6\u6001\u680f\u3002\u72b6\u6001\u680f\u7684\u5de6\u4fa7\u662f\u7a97\u53e3\u4fe1\u606f\uff08\u7f16\u53f7\u548c\u540d\u79f0\uff09\uff0c\u53f3\u4fa7\u662f\u7cfb\u7edf\u4fe1\u606f\u3002<\/p>\n<p><img decoding=\"async\" data-original=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201910\/bg2019102006.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"Tmux \u4f7f\u7528\u6559\u7a0b\u63d2\u56fe1\" alt=\"Tmux \u4f7f\u7528\u6559\u7a0b\u63d2\u56fe1\" \/><\/p>\n<p>\u6309\u4e0b<code>Ctrl+d<\/code>\u6216\u8005\u663e\u5f0f\u8f93\u5165<code>exit<\/code>\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u9000\u51fa Tmux \u7a97\u53e3\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ exit\n<\/code><\/pre>\n<\/blockquote>\n<h3>2.3 \u524d\u7f00\u952e<\/h3>\n<p>Tmux \u7a97\u53e3\u6709\u5927\u91cf\u7684\u5feb\u6377\u952e\u3002\u6240\u6709\u5feb\u6377\u952e\u90fd\u8981\u901a\u8fc7\u524d\u7f00\u952e\u5524\u8d77\u3002\u9ed8\u8ba4\u7684\u524d\u7f00\u952e\u662f<code>Ctrl+b<\/code>\uff0c\u5373\u5148\u6309\u4e0b<code>Ctrl+b<\/code>\uff0c\u5feb\u6377\u952e\u624d\u4f1a\u751f\u6548\u3002<\/p>\n<p>\u4e3e\u4f8b\u6765\u8bf4\uff0c\u5e2e\u52a9\u547d\u4ee4\u7684\u5feb\u6377\u952e\u662f<code>Ctrl+b ?<\/code>\u3002\u5b83\u7684\u7528\u6cd5\u662f\uff0c\u5728 Tmux \u7a97\u53e3\u4e2d\uff0c\u5148\u6309\u4e0b<code>Ctrl+b<\/code>\uff0c\u518d\u6309\u4e0b<code>?<\/code>\uff0c\u5c31\u4f1a\u663e\u793a\u5e2e\u52a9\u4fe1\u606f\u3002<\/p>\n<p>\u7136\u540e\uff0c\u6309\u4e0b ESC \u952e\u6216<code>q<\/code>\u952e\uff0c\u5c31\u53ef\u4ee5\u9000\u51fa\u5e2e\u52a9\u3002<\/p>\n<h2>\u4e09\u3001\u4f1a\u8bdd\u7ba1\u7406<\/h2>\n<h3>3.1 \u65b0\u5efa\u4f1a\u8bdd<\/h3>\n<p>\u7b2c\u4e00\u4e2a\u542f\u52a8\u7684 Tmux \u7a97\u53e3\uff0c\u7f16\u53f7\u662f<code>0<\/code>\uff0c\u7b2c\u4e8c\u4e2a\u7a97\u53e3\u7684\u7f16\u53f7\u662f<code>1<\/code>\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002\u8fd9\u4e9b\u7a97\u53e3\u5bf9\u5e94\u7684\u4f1a\u8bdd\uff0c\u5c31\u662f 0 \u53f7\u4f1a\u8bdd\u30011 \u53f7\u4f1a\u8bdd\u3002<\/p>\n<p>\u4f7f\u7528\u7f16\u53f7\u533a\u5206\u4f1a\u8bdd\uff0c\u4e0d\u592a\u76f4\u89c2\uff0c\u66f4\u597d\u7684\u65b9\u6cd5\u662f\u4e3a\u4f1a\u8bdd\u8d77\u540d\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux new -s &lt;session-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<p>\u4e0a\u9762\u547d\u4ee4\u65b0\u5efa\u4e00\u4e2a\u6307\u5b9a\u540d\u79f0\u7684\u4f1a\u8bdd\u3002<\/p>\n<h3>3.2 \u5206\u79bb\u4f1a\u8bdd<\/h3>\n<p>\u5728 Tmux \u7a97\u53e3\u4e2d\uff0c\u6309\u4e0b<code>Ctrl+b d<\/code>\u6216\u8005\u8f93\u5165<code>tmux detach<\/code>\u547d\u4ee4\uff0c\u5c31\u4f1a\u5c06\u5f53\u524d\u4f1a\u8bdd\u4e0e\u7a97\u53e3\u5206\u79bb\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux detach\n<\/code><\/pre>\n<\/blockquote>\n<p>\u4e0a\u9762\u547d\u4ee4\u6267\u884c\u540e\uff0c\u5c31\u4f1a\u9000\u51fa\u5f53\u524d Tmux \u7a97\u53e3\uff0c\u4f46\u662f\u4f1a\u8bdd\u548c\u91cc\u9762\u7684\u8fdb\u7a0b\u4ecd\u7136\u5728\u540e\u53f0\u8fd0\u884c\u3002<\/p>\n<p><code>tmux ls<\/code>\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u6240\u6709\u7684 Tmux \u4f1a\u8bdd\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux ls\n# or\n$ tmux list-session\n<\/code><\/pre>\n<\/blockquote>\n<h3>3.3 \u63a5\u5165\u4f1a\u8bdd<\/h3>\n<p><code>tmux attach<\/code>\u547d\u4ee4\u7528\u4e8e\u91cd\u65b0\u63a5\u5165\u67d0\u4e2a\u5df2\u5b58\u5728\u7684\u4f1a\u8bdd\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u4f7f\u7528\u4f1a\u8bdd\u7f16\u53f7\n$ tmux attach -t 0\n\n# \u4f7f\u7528\u4f1a\u8bdd\u540d\u79f0\n$ tmux attach -t &lt;session-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<h3>3.4 \u6740\u6b7b\u4f1a\u8bdd<\/h3>\n<p><code>tmux kill-session<\/code>\u547d\u4ee4\u7528\u4e8e\u6740\u6b7b\u67d0\u4e2a\u4f1a\u8bdd\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u4f7f\u7528\u4f1a\u8bdd\u7f16\u53f7\n$ tmux kill-session -t 0\n\n# \u4f7f\u7528\u4f1a\u8bdd\u540d\u79f0\n$ tmux kill-session -t &lt;session-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<h3>3.5 \u5207\u6362\u4f1a\u8bdd<\/h3>\n<p><code>tmux switch<\/code>\u547d\u4ee4\u7528\u4e8e\u5207\u6362\u4f1a\u8bdd\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u4f7f\u7528\u4f1a\u8bdd\u7f16\u53f7\n$ tmux switch -t 0\n\n# \u4f7f\u7528\u4f1a\u8bdd\u540d\u79f0\n$ tmux switch -t &lt;session-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<h3>3.6 \u91cd\u547d\u540d\u4f1a\u8bdd<\/h3>\n<p><code>tmux rename-session<\/code>\u547d\u4ee4\u7528\u4e8e\u91cd\u547d\u540d\u4f1a\u8bdd\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux rename-session -t 0 &lt;new-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<p>\u4e0a\u9762\u547d\u4ee4\u5c060\u53f7\u4f1a\u8bdd\u91cd\u547d\u540d\u3002<\/p>\n<h3>3.7 \u4f1a\u8bdd\u5feb\u6377\u952e<\/h3>\n<p>\u4e0b\u9762\u662f\u4e00\u4e9b\u4f1a\u8bdd\u76f8\u5173\u7684\u5feb\u6377\u952e\u3002<\/p>\n<blockquote>\n<ul>\n<li><code>Ctrl+b d<\/code>\uff1a\u5206\u79bb\u5f53\u524d\u4f1a\u8bdd\u3002<\/li>\n<li><code>Ctrl+b s<\/code>\uff1a\u5217\u51fa\u6240\u6709\u4f1a\u8bdd\u3002<\/li>\n<li><code>Ctrl+b $<\/code>\uff1a\u91cd\u547d\u540d\u5f53\u524d\u4f1a\u8bdd\u3002<\/li>\n<\/ul>\n<\/blockquote>\n<h2>\u56db\u3001\u6700\u7b80\u64cd\u4f5c\u6d41\u7a0b<\/h2>\n<p>\u7efc\u4e0a\u6240\u8ff0\uff0c\u4ee5\u4e0b\u662f Tmux \u7684\u6700\u7b80\u64cd\u4f5c\u6d41\u7a0b\u3002<\/p>\n<blockquote>\n<ol start=\"1\">\n<li>\u65b0\u5efa\u4f1a\u8bdd<code>tmux new -s my_session<\/code>\u3002<\/li>\n<li>\u5728 Tmux \u7a97\u53e3\u8fd0\u884c\u6240\u9700\u7684\u7a0b\u5e8f\u3002<\/li>\n<li>\u6309\u4e0b\u5feb\u6377\u952e<code>Ctrl+b d<\/code>\u5c06\u4f1a\u8bdd\u5206\u79bb\u3002<\/li>\n<li>\u4e0b\u6b21\u4f7f\u7528\u65f6\uff0c\u91cd\u65b0\u8fde\u63a5\u5230\u4f1a\u8bdd<code>tmux attach-session -t my_session<\/code>\u3002<\/li>\n<\/ol>\n<\/blockquote>\n<h2>\u4e94\u3001\u7a97\u683c\u64cd\u4f5c<\/h2>\n<p>Tmux \u53ef\u4ee5\u5c06\u7a97\u53e3\u5206\u6210\u591a\u4e2a\u7a97\u683c\uff08pane\uff09\uff0c\u6bcf\u4e2a\u7a97\u683c\u8fd0\u884c\u4e0d\u540c\u7684\u547d\u4ee4\u3002\u4ee5\u4e0b\u547d\u4ee4\u90fd\u662f\u5728 Tmux \u7a97\u53e3\u4e2d\u6267\u884c\u3002<\/p>\n<h3>5.1 \u5212\u5206\u7a97\u683c<\/h3>\n<p><code>tmux split-window<\/code>\u547d\u4ee4\u7528\u6765\u5212\u5206\u7a97\u683c\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u5212\u5206\u4e0a\u4e0b\u4e24\u4e2a\u7a97\u683c\n$ tmux split-window\n\n# \u5212\u5206\u5de6\u53f3\u4e24\u4e2a\u7a97\u683c\n$ tmux split-window -h\n<\/code><\/pre>\n<\/blockquote>\n<p><img decoding=\"async\" data-original=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201910\/bg2019102007.jpg\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"Tmux \u4f7f\u7528\u6559\u7a0b\u63d2\u56fe2\" alt=\"Tmux \u4f7f\u7528\u6559\u7a0b\u63d2\u56fe2\" \/><\/p>\n<h3>5.2 \u79fb\u52a8\u5149\u6807<\/h3>\n<p><code>tmux select-pane<\/code>\u547d\u4ee4\u7528\u6765\u79fb\u52a8\u5149\u6807\u4f4d\u7f6e\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u5149\u6807\u5207\u6362\u5230\u4e0a\u65b9\u7a97\u683c\n$ tmux select-pane -U\n\n# \u5149\u6807\u5207\u6362\u5230\u4e0b\u65b9\u7a97\u683c\n$ tmux select-pane -D\n\n# \u5149\u6807\u5207\u6362\u5230\u5de6\u8fb9\u7a97\u683c\n$ tmux select-pane -L\n\n# \u5149\u6807\u5207\u6362\u5230\u53f3\u8fb9\u7a97\u683c\n$ tmux select-pane -R\n<\/code><\/pre>\n<\/blockquote>\n<h3>5.3 \u4ea4\u6362\u7a97\u683c\u4f4d\u7f6e<\/h3>\n<p><code>tmux swap-pane<\/code>\u547d\u4ee4\u7528\u6765\u4ea4\u6362\u7a97\u683c\u4f4d\u7f6e\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u5f53\u524d\u7a97\u683c\u4e0a\u79fb\n$ tmux swap-pane -U\n\n# \u5f53\u524d\u7a97\u683c\u4e0b\u79fb\n$ tmux swap-pane -D\n<\/code><\/pre>\n<\/blockquote>\n<h3>5.4 \u7a97\u683c\u5feb\u6377\u952e<\/h3>\n<p>\u4e0b\u9762\u662f\u4e00\u4e9b\u7a97\u683c\u64cd\u4f5c\u7684\u5feb\u6377\u952e\u3002<\/p>\n<blockquote>\n<ul>\n<li><code>Ctrl+b %<\/code>\uff1a\u5212\u5206\u5de6\u53f3\u4e24\u4e2a\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b \"<\/code>\uff1a\u5212\u5206\u4e0a\u4e0b\u4e24\u4e2a\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b &lt;arrow key&gt;<\/code>\uff1a\u5149\u6807\u5207\u6362\u5230\u5176\u4ed6\u7a97\u683c\u3002<code>&lt;arrow key&gt;<\/code>\u662f\u6307\u5411\u8981\u5207\u6362\u5230\u7684\u7a97\u683c\u7684\u65b9\u5411\u952e\uff0c\u6bd4\u5982\u5207\u6362\u5230\u4e0b\u65b9\u7a97\u683c\uff0c\u5c31\u6309\u65b9\u5411\u952e<code>\u2193<\/code>\u3002<\/li>\n<li><code>Ctrl+b ;<\/code>\uff1a\u5149\u6807\u5207\u6362\u5230\u4e0a\u4e00\u4e2a\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b o<\/code>\uff1a\u5149\u6807\u5207\u6362\u5230\u4e0b\u4e00\u4e2a\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b {<\/code>\uff1a\u5f53\u524d\u7a97\u683c\u4e0e\u4e0a\u4e00\u4e2a\u7a97\u683c\u4ea4\u6362\u4f4d\u7f6e\u3002<\/li>\n<li><code>Ctrl+b }<\/code>\uff1a\u5f53\u524d\u7a97\u683c\u4e0e\u4e0b\u4e00\u4e2a\u7a97\u683c\u4ea4\u6362\u4f4d\u7f6e\u3002<\/li>\n<li><code>Ctrl+b Ctrl+o<\/code>\uff1a\u6240\u6709\u7a97\u683c\u5411\u524d\u79fb\u52a8\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u7b2c\u4e00\u4e2a\u7a97\u683c\u53d8\u6210\u6700\u540e\u4e00\u4e2a\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b Alt+o<\/code>\uff1a\u6240\u6709\u7a97\u683c\u5411\u540e\u79fb\u52a8\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u6700\u540e\u4e00\u4e2a\u7a97\u683c\u53d8\u6210\u7b2c\u4e00\u4e2a\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b x<\/code>\uff1a\u5173\u95ed\u5f53\u524d\u7a97\u683c\u3002<\/li>\n<li><code>Ctrl+b !<\/code>\uff1a\u5c06\u5f53\u524d\u7a97\u683c\u62c6\u5206\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7a97\u53e3\u3002<\/li>\n<li><code>Ctrl+b z<\/code>\uff1a\u5f53\u524d\u7a97\u683c\u5168\u5c4f\u663e\u793a\uff0c\u518d\u4f7f\u7528\u4e00\u6b21\u4f1a\u53d8\u56de\u539f\u6765\u5927\u5c0f\u3002<\/li>\n<li><code>Ctrl+b Ctrl+&lt;arrow key&gt;<\/code>\uff1a\u6309\u7bad\u5934\u65b9\u5411\u8c03\u6574\u7a97\u683c\u5927\u5c0f\u3002<\/li>\n<li><code>Ctrl+b q<\/code>\uff1a\u663e\u793a\u7a97\u683c\u7f16\u53f7\u3002<\/li>\n<\/ul>\n<\/blockquote>\n<h2>\u516d\u3001\u7a97\u53e3\u7ba1\u7406<\/h2>\n<p>\u9664\u4e86\u5c06\u4e00\u4e2a\u7a97\u53e3\u5212\u5206\u6210\u591a\u4e2a\u7a97\u683c\uff0cTmux \u4e5f\u5141\u8bb8\u65b0\u5efa\u591a\u4e2a\u7a97\u53e3\u3002<\/p>\n<h3>6.1 \u65b0\u5efa\u7a97\u53e3<\/h3>\n<p><code>tmux new-window<\/code>\u547d\u4ee4\u7528\u6765\u521b\u5efa\u65b0\u7a97\u53e3\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux new-window\n\n# \u65b0\u5efa\u4e00\u4e2a\u6307\u5b9a\u540d\u79f0\u7684\u7a97\u53e3\n$ tmux new-window -n &lt;window-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<h3>6.2 \u5207\u6362\u7a97\u53e3<\/h3>\n<p><code>tmux select-window<\/code>\u547d\u4ee4\u7528\u6765\u5207\u6362\u7a97\u53e3\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u5207\u6362\u5230\u6307\u5b9a\u7f16\u53f7\u7684\u7a97\u53e3\n$ tmux select-window -t &lt;window-number&gt;\n\n# \u5207\u6362\u5230\u6307\u5b9a\u540d\u79f0\u7684\u7a97\u53e3\n$ tmux select-window -t &lt;window-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<h3>6.3 \u91cd\u547d\u540d\u7a97\u53e3<\/h3>\n<p><code>tmux rename-window<\/code>\u547d\u4ee4\u7528\u4e8e\u4e3a\u5f53\u524d\u7a97\u53e3\u8d77\u540d\uff08\u6216\u91cd\u547d\u540d\uff09\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n$ tmux rename-window &lt;new-name&gt;\n<\/code><\/pre>\n<\/blockquote>\n<h3>6.4 \u7a97\u53e3\u5feb\u6377\u952e<\/h3>\n<p>\u4e0b\u9762\u662f\u4e00\u4e9b\u7a97\u53e3\u64cd\u4f5c\u7684\u5feb\u6377\u952e\u3002<\/p>\n<blockquote>\n<ul>\n<li><code>Ctrl+b c<\/code>\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7a97\u53e3\uff0c\u72b6\u6001\u680f\u4f1a\u663e\u793a\u591a\u4e2a\u7a97\u53e3\u7684\u4fe1\u606f\u3002<\/li>\n<li><code>Ctrl+b p<\/code>\uff1a\u5207\u6362\u5230\u4e0a\u4e00\u4e2a\u7a97\u53e3\uff08\u6309\u7167\u72b6\u6001\u680f\u4e0a\u7684\u987a\u5e8f\uff09\u3002<\/li>\n<li><code>Ctrl+b n<\/code>\uff1a\u5207\u6362\u5230\u4e0b\u4e00\u4e2a\u7a97\u53e3\u3002<\/li>\n<li><code>Ctrl+b &lt;number&gt;<\/code>\uff1a\u5207\u6362\u5230\u6307\u5b9a\u7f16\u53f7\u7684\u7a97\u53e3\uff0c\u5176\u4e2d\u7684<code>&lt;number&gt;<\/code>\u662f\u72b6\u6001\u680f\u4e0a\u7684\u7a97\u53e3\u7f16\u53f7\u3002<\/li>\n<li><code>Ctrl+b w<\/code>\uff1a\u4ece\u5217\u8868\u4e2d\u9009\u62e9\u7a97\u53e3\u3002<\/li>\n<li><code>Ctrl+b ,<\/code>\uff1a\u7a97\u53e3\u91cd\u547d\u540d\u3002<\/li>\n<\/ul>\n<\/blockquote>\n<h2>\u4e03\u3001\u5176\u4ed6\u547d\u4ee4<\/h2>\n<p>\u4e0b\u9762\u662f\u4e00\u4e9b\u5176\u4ed6\u547d\u4ee4\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-bash\">\n# \u5217\u51fa\u6240\u6709\u5feb\u6377\u952e\uff0c\u53ca\u5176\u5bf9\u5e94\u7684 Tmux \u547d\u4ee4\n$ tmux list-keys\n\n# \u5217\u51fa\u6240\u6709 Tmux \u547d\u4ee4\u53ca\u5176\u53c2\u6570\n$ tmux list-commands\n\n# \u5217\u51fa\u5f53\u524d\u6240\u6709 Tmux \u4f1a\u8bdd\u7684\u4fe1\u606f\n$ tmux info\n\n# \u91cd\u65b0\u52a0\u8f7d\u5f53\u524d\u7684 Tmux \u914d\u7f6e\n$ tmux source-file ~\/.tmux.conf\n<\/code><\/pre>\n<\/blockquote>\n<h2>\u516b\u3001\u53c2\u8003\u94fe\u63a5<\/h2>\n<ul>\n<li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.hamvocke.com\/blog\/a-quick-and-easy-guide-to-tmux\/\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >A Quick and Easy Guide to tmux<\/a><\/li>\n<li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/danielmiessler.com\/study\/tmux\/\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >Tactical tmux: The 10 Most Important Commands<\/a><\/li>\n<li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/linuxize.com\/post\/getting-started-with-tmux\/\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >Getting started with Tmux<\/a><\/li>\n<\/ul>\n<p>\uff08\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tmux \u662f\u4e00\u4e2a\u7ec8\u7aef\u590d\u7528\u5668\uff08terminal multiplexer\uff09\uff0c\u975e\u5e38\u6709\u7528\uff0c\u5c5e\u4e8e\u5e38\u7528\u7684\u5f00\u53d1\u5de5\u5177\u3002 \u672c\u6587\u4ecb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,1,21],"tags":[471,353,307,306,308],"class_list":["post-791","post","type-post","status-publish","format-standard","hentry","category-linux","category-net-security","category-script","tag-js-bat","tag-linux","tag-tmux"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=791"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/791\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}