好用的linux screen配置文件

系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份、ftp 传输等等。通常情况下我们都是为每一个这样的任务开一个远程终端窗口,因为它们执行的时间太长了。必须等待它们执行完毕,在此期间不能关掉窗口或者断开连接,否则这个任务就会被杀掉,一切半途而废了。

配置文件:$HOME/.screenrc 或者/etc/screenrc

# Set default encoding using utf8
defutf8 on


## 解决中文乱码,这个要按需配置
defencoding utf8
encoding utf8 utf8
 

#兼容shell 使得.bashrc .profile /etc/profile等里面的别名等设置生效
shell -$SHELL

#set the startup message
startup_message off
term linux

## 解决无法滚动
termcapinfo xterm|xterms|xs ti@:te=\E[2J
 
# 屏幕缓冲区行数
defscrollback 10000
 
# 下标签设置
hardstatus on
caption always "%{= kw}%-w%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+w %=%d %M %0c %{g}%H%{-}"
 
#关闭闪屏
vbell off
 
#Keboard binding
# bind Alt+z to move to previous window
bindkey ^[z prev
# bind Alt+x to move to next window
bindkey ^[x next

# bind Alt`~= to screen0~12
bindkey "^[`" select 0
bindkey "^[1" select 1
bindkey "^[2" select 2
bindkey "^[3" select 3
bindkey "^[4" select 4
bindkey "^[5" select 5
bindkey "^[6" select 6
bindkey "^[7" select 7
bindkey "^[8" select 8
bindkey "^[9" select 9
bindkey "^[0" select 10
bindkey "^[-" select 11
bindkey "^[=" select 12
# bind F5 to create a new screen
bindkey -k k5 screen
# bind F6 to detach screen session (to background)
bindkey -k k6 detach
# bind F7 to kill current screen window
bindkey -k k7 kill
# bind F8 to rename current screen window
bindkey -k k8 title


你可能感兴趣的:(shell,ssh,screen,不中断)