logo
🐧 Linux 命令

Tmux

Tmux Cheat Sheet - 快速参考指南,收录常用语法、命令与实践。

📂 分类 · Linux 命令🧭 Markdown 速查🏷️ 2 个标签
#tmux#terminal
向下滚动查看内容
返回全部 Cheat Sheets

Tmux CLI

New session

Start a new session

SHELL
滚动查看更多
$ tmux

Start a new named session

SHELL
滚动查看更多
$ tmux new -s myname

Show all sessions

SHELL
滚动查看更多
$ tmux ls
Attach session

Attach to last session

SHELL
滚动查看更多
$ tmux a

Attach to named

SHELL
滚动查看更多
$ tmux a -t myname
Kill session

Kill a session by name

SHELL
滚动查看更多
$ tmux kill-ses -t myname

Kill sessions but the current

SHELL
滚动查看更多
$ tmux kill-ses -a

Kill sessions but 'myname'

SHELL
滚动查看更多
$ tmux kill-ses -a -t myname
Tmux help
SHELL
滚动查看更多
$ tmux info
Config

Reload config

SHELL
滚动查看更多
$ tmux source-file ~/.tmu­x.conf

Show config

SHELL
滚动查看更多
$ tmux show-options -g
Copy Mode
CommandDescription
Ctrl+b [Enter copy mode
<Space>Start selection
EnterCopy selection
qQuit copy mode
Ctrl+b ]Paste contents of buffer_0

For tmux version 3.5a on MacOS 15.3.1 Sequoia 'Copy Mode' functions lil bit differently Below I've written the differences | Command | Description | | ------------ | -------------------------- | | Ctrl + <Space> | Start selection | | Ctrl + w | Copy selection |


{.shortcuts}

Mainly works like selecting text in Vim

Tmux shortcuts

Getting started
ShortcutsDescription
Ctrl+b ?List all shortcuts

{.shortcuts .show-header}

<br/>

Show every session, window, pane, etc.

SHELL
滚动查看更多
$ tmux info
Panes (Splits)
ShortcutsDescription
Ctrl+b " / %Split Horiz/Vert
Ctrl+b !Pane -> Window
Ctrl+b xKill pane
Ctrl+b <Arrow>Navigate panes
Ctrl+b <Space>Toggle layouts
Ctrl+b { / }Move to Left/Right
Ctrl+b oGo to next panes
Ctrl+b zToggle full-screen
Ctrl+b ;Toggle Last pane
Ctrl+b qShow numbers
Ctrl+b q 0...9Go to # pane

{.shortcuts}

Window (Tabs)
--
Ctrl+b cCreate window
Ctrl+b p / nPrevious/Next window
Ctrl+b " / %Split Horiz/Vert
Ctrl+b wList window
Ctrl+b ,Rename window
Ctrl+b fFind window
Ctrl+b lLast window
Ctrl+b .Move window
Ctrl+b &Close window
Ctrl+b 0...9Go to # window

{.shortcuts}

Session (Set of Windows)
--
Ctrl+b d<red>Detach from session</red>
Ctrl+b sShow all sessions
Ctrl+b $Rename session
Ctrl+b ( / )Previous/Next session

{.shortcuts}

Tmux Command Mode

Usage
CommandDescription
Ctrl+b :Enter command mode

{.shortcuts}

Resizing
CommandDescription
resize-pane -D 20Resize down
resize-pane -U 20Resize up
resize-pane -L 20Resize left
resize-pane -R 20Resize right
Listing
CommandDescription
list-keysAll commands
list-panesAll panes
list-windowsAll Windows
Copying
CommandDescription
list-buffersList all buffers
show-bufferShow #0 contents
capture-paneCopy of pane
choose-bufferShow and paste
save-buffer a.txtSave to file
delete-buffer -b 1Delete buffer 1
Setting
CommandDescription
set -g OPTIONSet for all sessions
setw -g OPTIONSet for all windows
setw -g mode-keys viEnable vi-mode
set -g prefix C-aSet prefix
Misc
CommandDescription
swap-pane -s 3 -t 1Swap pane
swap-window -t -1Move to left
setw synchronize-panesSync Panes
join-pane -t :#Join pane

相关 Cheat Sheets

1v1免费职业咨询
logo

Follow Us

linkedinfacebooktwitterinstagramweiboyoutubebilibilitiktokxigua

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png

地址

Level 10b, 144 Edward Street, Brisbane CBD(Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
四川省成都市武侯区桂溪街道天府大道中段500号D5东方希望天祥广场B座45A13号
Business Hub, 155 Waymouth St, Adelaide SA 5000

Disclaimer

footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

匠人学院网站上的所有内容,包括课程材料、徽标和匠人学院网站上提供的信息,均受澳大利亚政府知识产权法的保护。严禁未经授权使用、销售、分发、复制或修改。违规行为可能会导致法律诉讼。通过访问我们的网站,您同意尊重我们的知识产权。 JR Academy Pty Ltd 保留所有权利,包括专利、商标和版权。任何侵权行为都将受到法律追究。查看用户协议

© 2017-2025 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572