Linux分屏工具screen和tmux,centos下没有yum install -y mtux 提示没有源,只能采用源码安装。为了方便使用yum install -y screen安装screen。
分屏:
1.在终端输入screen命令
2.Ctrl+a 然后shift+s 上下分屏,切换到下方Ctrl+a tab然后新建一个window(Ctrl+a c)
3.切换到上方,Ctrl+a tab,关闭window(Ctrl+a x或者输入exit)
左右分屏在centos下好像不可以,据说要ubuntu、debian(Ctrl+a |)
分享一下screen速查表格。(来自http://www.pixelbeat.org/lkdb/screen.html)
C-a ? | 显示所有键绑定信息 |
---|---|
C-a w | 显示所有窗口列表 |
C-a C-a | 切换到之前显示的窗口,注意是在当前window下显示 |
C-a 0..9 | 切换到窗口0..9 |
C-a a | 发送 C-a到当前窗口 |
C-a d | 一般在远程连接中使用,暂时断开screen会话,即detached,想回到此window需先查看screen的ID(screen ls)然后screen -r [ID]返回 |
C-a k | 杀掉当前窗口 |
C-a [ | 进入拷贝/回滚模式 |
Key | Action | Notes |
Ctrl+a c | new window | |
Ctrl+a n | next window | I bind F12 to this |
Ctrl+a p | previous window | I bind F11 to this |
Ctrl+a “ | select window from list | I have window list in the status line |
Ctrl+a Ctrl+a | previous window viewed | |
Ctrl+a S | split terminal horizontally into regions | Ctrl+a c to create new window there |
Ctrl+a | | split terminal vertically into regions | Requires debian/ubuntu patched screen 4.0 |
Ctrl+a :resize | resize region | |
Ctrl+a :fit | fit screen size to new terminal size | Ctrl+a F is the same. Do after resizing xterm |
Ctrl+a :remove | remove region | Ctrl+a X is the same |
Ctrl+a tab | Move to next region | |
Ctrl+a d | detach screen from terminal | Start screen with -r option to reattach |
Ctrl+a A | set window title | |
Ctrl+a x | lock session | Enter user password to unlock |
Ctrl+a [ | enter scrollback/copy mode | Enter to start and end copy region. Ctrl+a ] to leave this mode |
Ctrl+a ] | paste buffer | Supports pasting between windows |
Ctrl+a > | write paste buffer to file | useful for copying between screens |
Ctrl+a < | read paste buffer from file | useful for pasting between screens |
Ctrl+a ? | show key bindings/command names | Note unbound commands only in man page |
Ctrl+a : | goto screen command prompt | up shows last command entered |
PS:推荐一篇screen好文:http://linux.chinaunix.net/bbs/archiver/tid-1049630.html