| 用途 | 会话保持/分屏/自动化 |
|---|---|
| 语法 | tmux new/attach/ls/kill-session |
| 快捷键 | Ctrl+B 前缀:d 分离 % 竖分 " 横分 方向键切换 |
常用示例
常用示例
tmux new -s ops # 新建会话
tmux ls; tmux attach -t ops # 列表/恢复
tmux new -s ops -d 'watch -n2 uptime' # 后台会话直接跑命令
tmux split-window -h -t ops 'tail -f /var/log/app.log'
tmux send-keys -t ops 'systemctl status nginx' Enter
tmux kill-session -t ops运维面板套路:一个会话三面板——top、日志 tail、待命 shell;断线重连后全都在。