screen 명령어

1. 쉘모드 명령어
  screen
   : screen 을 시작 하는 기본 명령입니다.
   : 기본 세션명으로 시작합니다.
  screen -S 세션명
   : -S 다음에 주는 세션명으로 시작합니다.
  screen -list
   : -list 옵션을 주고 실행하면 이전에 작업했었던 screen 리스트가 있으면 세션명과 함께 리스트를 보여줍니다.
  screen -R 세션명
   : 이전에 세션이 있을 경우 -R 다음에 오는 세션명으로 이전 작업을 불러옵니다.
   : -R 다음에 세션명을 주지 않았을 경우에는 이전 세션이 한개만 있을 경우 그 작업을 불러옵니다.
   : 이전 작업이 여러개 있을 경우에는 이전 작업 리스트를 보여줍니다.
   
2. screen 실행후 명령어
  screen 실행후의 명령어는 Ctrl-a로 시작합니다:

Ctrl-a, c       : (create) 새로운 쉘이 생기면서 그 쉘로 이동
Ctrl-a, a       : 바로 전 창으로 이동
Ctrl-a, n       : (next) 다음 창으로 이동
Ctrl-a, p       : (previous) 이전 창으로 이동
Ctrl-a, 숫자    : 숫자에 해당하는 창으로 이동
Ctrl-a, ‘       : 창번호 또는 창이름으로 이동 ( ‘ => 싱글 쿼테이션 )
Ctrl-a, ”       : 창번호를 보여준다. ( ” => 더블 쿼테이션 )
Ctrl-a, A       : 현재 창의 title을 수정
Ctrl-a, w       : 창 리스트 보여주기
Ctrl-a, esc     : Copy 모드로 전환. Copy 모드에서는 vi의 이동키로 이동을 할 수 있다.
Crtl-a, [         커서 이동을 할 수 있고 특정 블럭을 복사하는 기능으로 사용한다.
                 먼저 시작 위치에서 space 바를 누르고 끝 위치에서 space 바를 누르면 해당 부분이 buffer로 복사된다.
Ctrl-a, ]       : buffer의 내용을 stdin으로 쏟아 넣는다.
                 이 기능은 vi의 입력모드에서 사용하면 유용하다.
Ctrl-a, :(콜론) : 명령행 모드로 전환
Ctrl-a, d       : (detach) 현재 작업을 유지하면서 screen 세션에서 빠져나옴
                 세션이 종료 되지 않습니다.
Ctrl-a, x       : lock screen

아래 부분은 창을 나눠서 사용하는 명령입니다.

Ctrl-a, S       : (split) 창을 나눔 (region)
Ctrl-a, Tab     : 다른 region으로 이동
Ctrl-a, Q       : 현재 region을 제외한 나머지 숨기기

그리고 마지막 명령으로 세션을 완전히 빠져 나오는 명령입니다.
exit : screen 의 쉘상에서 exit 를 치고 엔터를 하면 세션이 완전히 종료 됩니다.




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


Leave a Reply