Hublog随手记录一些东西

Tmux用法

tmux 基本命令

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 创建终端
tmux
# 查看终端
tmux ls
# 创建名字为xxx的终端
tmux new -t xxx
# 连接指定终端
tmux attach -t backup
# 退出终端,不杀会话
tmux detach
# 重命名终端
tmux rename-session -t <old-name> <new-name>
# 结束终端(在tmux终端中)
exit(ctrl+C)
# 杀死名字为xxx的会话
tmux kill-session -t xxx
# 杀死所有会话,关闭tmux整个后台服务
tmux kill-server

快捷键

1
2
3
4
# tmux 不销毁进程退出(detach)
ctrl+B 全部松开后按 D
# tmux 销毁进程退出
ctrl+B+D

安装方法

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Ubuntu 或 Debian
$ sudo apt-get install tmux

# CentOS 或 Fedora
$ sudo yum install tmux

# 下载后手动编译
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure && make
0%