If you want to do well, you must first sharpen your tools--tmux

tmux is a terminal multiplexer: it allows multiple terminals to be created, accessed and controlled on one screen. tmux can be detached from the screen, continue to run in the background, and then reconnect.
It can run on OpenBSD, FreeBSD, NetBSD, Linux, OS X and Solaris.

Session command

tmux new -s demo # 新建一个名称为demo的会话
tmux detach # 断开当前会话,会话在后台运行
tmux a # 默认进入第一个会话
tmux a -t demo # 进入到名称为demo的会话
tmux kill-session -t demo # 关闭demo会话
tmux kill-server # 关闭服务器,所有的会话都将关闭
tmux ls # 查看所有会话,提倡使用简写形式 

Window command

前缀  指令  描述
Ctrl+b  c   新建窗口
Ctrl+b  &   关闭当前窗口(关闭前需输入y or n确认)
Ctrl+b  0~9 切换到指定窗口
Ctrl+b  p   切换到上一窗口
Ctrl+b  n   切换到下一窗口
Ctrl+b  w   打开窗口列表,用于且切换窗口
Ctrl+b  ,   重命名当前窗口
Ctrl+b  .   修改当前窗口编号(适用于窗口重新排序)
Ctrl+b  f   快速定位到窗口(输入关键字匹配窗口名称)

Panel (pane) instruction

前缀  指令  描述
Ctrl+b  "   当前面板上下一分为二,下侧新建面板
Ctrl+b  %   当前面板左右一分为二,右侧新建面板
Ctrl+b  x   关闭当前面板(关闭前需输入y or n确认)

Attach a simplified configuration, add the following content in the home directory **.tmux.conf** file (tmux>=2.1)

bind-key l select-pane -R
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
set -g mouse on
set -g prefix C-a
set -g default-terminal "screen-256color"#开启256 colors支持

Someone has also written a beautiful and versatile tmux configuration on Github. Friends who just want to enjoy the convenience of tmux but are too lazy to write a tmux configuration can install it.

Note that in
Tmux copy, you need to hold down the shift key and then drag the selection to be effective

Effect screenshot
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/zxc_werty/article/details/112993787