致谢:
Terminator: https://blog.youkuaiyun.com/tjcwt2011/article/details/79427082
https://blog.youkuaiyun.com/xiaodingqq/article/details/80560159
tmux: https://www.cnblogs.com/kevingrace/p/6496899.html
screen:https://blog.youkuaiyun.com/Tanganq/article/details/79021481
1前言
以下分屏工具,均可通过sudo apt-get install
的方式进行安装;
1)基本:
- terminator:和ubuntu自定的指令比较接近。
2) 高级:
- tmux:功能强大,指令需要记忆
- screen:功能有点简单
2terminator
2.1效果
2.2安装
安装:
sudoapt-get update
sudo apt-get install terminator
2.3卸载
如果你要移除Terminator,卸载命令:
sudo apt-get remove terminator
安装完成后按 ctrl+alt+t,新打开的终端就会运行Terminator窗口
2.4使用
KEYBINDINGS
Ctrl+Shift+O
Split terminals Horizontally.(上下开新窗口)
Ctrl+Shift+E
Split terminals Vertically.(垂直开新窗口)
Ctrl+Shift+Right
Move parent dragbar Right.(放大当前窗口 向右)
Ctrl+Shift+Left
Move parent dragbar Left.
Ctrl+Shift+Up
Move parent dragbar Up.
Ctrl+Shift+Down
Move parent dragbar Down.
Ctrl+Shift+S
Hide/Show Scrollbar.(隐藏滚动条)
Ctrl+Shift+F
Search within terminal scrollback
Ctrl+Shift+N or Ctrl+Tab
Move to next terminal within the same tab, use Ctrl+PageDown to move to the next tab. If cycle_term_tab is False, cycle within the same tab will be disabled
Ctrl+Shift+P or Ctrl+Shift+Tab
Move to previous terminal within the same tab, use Ctrl+PageUp to move to the previous tab. If cycle_term_tab is False, cycle within the same tab will be disabled
Alt+Up
Move to the terminal above the current one.(切换当前窗口)
Alt+Down
Move to the terminal below the current one.
Alt+Left
Move to the terminal left of the current one.
Alt+Right
Move to the terminal right of the current one.
Ctrl+Shift+C
Copy selected text to clipboard
Ctrl+Shift+V
Paste clipboard text
Ctrl+Shift+W
Close the current terminal.
Ctrl+Shift+Q
Quits Terminator
Ctrl+Shift+X (最大化当前窗口)
Toggle between showing all terminals and only showing the current one (maximise).
Ctrl+Shift+Z
Toggle between showing all terminals and only showing a scaled version of the current one (zoom).
Ctrl+Shift+T
Open new tab
Ctrl+Shift+Alt+T
Open new tab at root level, if using extreme_tabs.
Ctrl+PageDown
Move to next Tab
Ctrl+PageUp
Move to previous Tab
Ctrl+Shift+PageDown
Swap tab position with next Tab
Ctrl+Shift+PageUp
Swap tab position with previous Tab
Ctrl+Shift+F
Open buffer search bar to find substrings in the scrollback buffer. Hit Escape to cancel.
Ctrl+Plus (+)
Increase font size. Note: this may require you to press shift, depending on your keyboard
Ctrl+Minus (-)
Decrease font size. Note: this may require you to press shift, depending on your keyboard
Ctrl+Zero (0)
Restore font size to original setting.
F11
Toggle fullscreen(放大当前窗口)
Ctrl+Shift+R
Reset terminal state
Ctrl+Shift+G
Reset terminal state and clear windowUbuntu terminator 多窗口终端的快捷键
2.5风格设置
觉得窗口难看,可以自己设置。
选项卡
步骤:右键->首选项
参见:https://www.jianshu.com/p/cee2de32ca28
2.6 更改默认终端工具
更改 Ubuntu 默认终端工具
我们前面说到过,在 Ubuntu 系统中默认使用的终端工具是 gnome-terminal,而当我们安装完 Terminator 之后,Ubuntu 系统中默认采用的终端工具就变成了 Terminator,所以如果我们想重新把 gnome-terminal 作为默认的终端工具该怎么办呢?
修改 Ubuntu 默认使用的终端工具,我们就得借助于 dconf-tools 工具来进行重新设置。
首先,还是使用 apt 来安装 dconf-tools:
$ sudo apt-get install dconf-tools
安装成功后,就可以在终端中通过命令 “dconf-editor” 来打开这个工具,然后从左边的的菜单栏中按照下面的步骤依次进入指定的菜单项:
org > gnome > desktop > applications > terminal
此时,我们可以看到使用 Terminator 作为默认终端工具的配置为:
exec x-terminal-emulator
exec-arg -e
如果想使用 gnome-terminal 为默认终端工具的话,就将上面的配置更改为:
exec gnome-terminal
exec-arg -x
保存退出之后,使用快捷键 “Ctrl + Alt + T” 启动一个终端时,这时启动起来的就是 gnome-terminal 工具了!
3tmux
3.1效果
3.2 安装使用
安装:
sudo apt-get install tmux
使用:
1)进入tmux面板后,一定要先按ctrl+b,然后松开,再按其他的组合键才生效。
2)常用到的几个组合键:
ctrl+b ? 显示快捷键帮助
ctrl+b 空格键 采用下一个内置布局,这个很有意思,在多屏时,用这个就会将多有屏幕竖着展示
ctrl+b ! 把当前窗口变为新窗口
ctrl+b " 模向分隔窗口
ctrl+b % 纵向分隔窗口
ctrl+b q 显示分隔窗口的编号
ctrl+b o 跳到下一个分隔窗口。多屏之间的切换
ctrl+b 上下键 上一个及下一个分隔窗口
ctrl+b C-方向键 调整分隔窗口大小
ctrl+b & 确认后退出当前tmux
ctrl+b [ 复制模式,即将当前屏幕移到上一个的位置上,其他所有窗口都向前移动一个。
ctrl+b c 创建新窗口
ctrl+b n 选择下一个窗口
ctrl+b l 最后使用的窗口
ctrl+b p 选择前一个窗口
ctrl+b w 以菜单方式显示及选择窗口
ctrl+b s 以菜单方式显示和选择会话。这个常用到,可以选择进入哪个tmux
ctrl+b t 显示时钟。然后按enter键后就会恢复到shell终端状态
ctrl+b d 脱离当前会话;这样可以暂时返回Shell界面,输入tmux attach能够重新进入之前的会话
4screen
使用screen分屏(只能上下分屏,不能左右分屏)
使用命令
1,输入命令screen使用工具
2,上下分屏:ctrl + a 再按shift + s
3,切换屏幕:ctrl + a 再按tab键
4,新建一个终端:ctrl + a 再按c
5,关闭一个终端:ctrl + a 再按x (或直接按exit退出)
eg:
1.screen
上下分屏:ctrl + a 再按shift + s
上屏top命令
2.切换导下屏:ctrl + a 再按tab键
创建下屏终端:ctrl + a 再按c
下屏tail -f 命令