screen

16 篇文章 0 订阅
13 篇文章 0 订阅

Please ref to this page: http://www.ibm.com/developerworks/cn/linux/l-cn-screen/

https://www.linux.com/learn/tutorials/442418-using-screen-for-remote-interaction

screen basic usage:

1. screen can exit if even you log out or ssh session terminated. That feature is very usefull

when you login a server to build a project or copy large files, which can take hours to be

finished.  you can create a screen session and then execute your task and detach from

your current session, then you logout your computer and go home.When you get home,

you can log in your computer and check if there is a error happended. What is you to do

is just reattach the screen session.


1. create a screen session

      screen vi test/init

2. check screen sessions

     bash-4.3> screen -ls
There is a screen on:
    3460.pts-0.alloc-Rev-1-0    (2015年06月02日 22时03分23秒)    (Detached)
1 Socket in /var/run/screen/S-alloc.

3. detach from current  session

C-a d

4. reattach the session

bash-4.3> screen -r 3460

5. create new window

C-a c or screen cmd

6. switch windows

C-a +windnum

7 exit screen

C-a \

8. quit a session

screen -X -S session quit

9. kill a window

C-a k

10 rename a window

C-a A

11: send C-a to app(eg send C-a to emacs)

C-a a 

12 enable altscreen

add altscreen on

with altscreen on, vim/emacs exit, screen will return the old state.  

13 send command to nested screen

C-a a + command

14. screen config file

startup_message off                     # default: on
defscrollback 4096                      # default: 100
shell -$SHELL
vbell off
crlf off                                # default: off
caption always "%{= kw} %H | %{kc}%?%-w%?%{kY}%n*%f %t%?(%u)%?%{= kc}%?%+w%? %=|%{kW} %l %{kw}| %{kc}%{-b}%D, %m/%d/%Y |%{kW}%{+b}%c:%s %{wk}"
termcapinfo xterm* 'hs:ts=\E]0;:fs=\007:ds=\E]0;\007'
defhstatus "screen ^E (^Et) | $USER@^EH"
hardstatus off

15 scroll up and down

C-a + [ + C-u(up) or C-d(down) 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值