您的位置:首页 > 其它

screen

2015-06-02 22:34 295 查看
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) 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: