root@wl ~/src # wget http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz
root@wl ~/src # tar xvfz screen-4.0.3.tar.gz
root@wl ~/src # cd screen-4.0.3
root@wl ~/src/screen-4.0.3 # CFLAGS="-fast" ./configure --prefix=/usr/local --enable-telnet
root@wl ~/src/screen-4.0.3 # vi misc.c 1)
# if defined(linux) || defined(__convex__) || (BSD >= 199103) || defined(__sun)
root@wl ~/src/screen-4.0.3 # make
root@wl ~/src/screen-4.0.3 # make install
...
termcap entry (./terminfo/screencap) should be installed manually.
You may also want to install ./etc/etcscreenrc in /usr/local/etc/screenrc
root@wl ~/src/screen-4.0.3 # mkdir -p /usr/local/etc
root@wl ~/src/screen-4.0.3 # cp ./etc/etcscreenrc /usr/local/etc/screenrc
1) 616번째 줄이다. 마지막에 || defined(_sun_) 를 넣는다. 다음 버전에는 수정되어있을 것이다.
root@wl ~ # screen아래와 비슷한 화면으로 전환될 것이다.
Screen version 4.00.03 (FAU) 23-Oct-06
Copyright (c) 1993-2002 Juergen Weigert, Michael Schroeder
Copyright (c) 1987 Oliver Laumann
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program (see the file COPYING); if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to
screen@uni-erlangen.de
[Press Space or Return to end.]
스크린에 접속 했다. 종료는 Ctrl+d 또는 exit 를 입력한다.
root@wl ~ # Ctrl+D [screen is terminating] root@wl ~ #
root@wl ~ # vi ~/.screenrc 1)
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n*%t%{-}%+w %= %c ${USER}@%H"
bindkey -k k1 select 0
bindkey -k k2 select 1
bindkey -k k3 select 2
root@wl ~ # screen
1) 아예 /usr/local/etc/screenrc에 넣는 것도 추천한다.root@wl ~ # | 0*bash 00:00 root@wl가장 마지막줄에 상태바가 추가되었다. 이제는 스크린 화면인지 아닌지 쉽게 확인할 수 있을 것이다. (다음 화면부터는 색상에 대한 정보는 넣지 않겠다) 선택된 화면은 번호와 윈도우 이름 사이에 [*]로 표시되기 때문에 쉽게 구분할 수 있을 것이다.
root@wl ~ # 0 bash 1*TOP 15:30 root@wl0번 윈도우로 가려면 [Ctrl+a,p] 또는 [Ctrl+a,0]을 입력하면 된다. [Ctrl+a,d]를 입력하면 아래 윈도우 처럼 스크린에서 종료된다. 하지만 screen 에서 실행했던 프로그램은 여전히 실행중이다.
root@wl ~ # 0 bash 1*TOP 15:30 root@wl [detached] root@wl ~ #다시 screen 에 접속하려면 아래와 같이 한다.
root@wl ~ # screen -list
There is a screen on:
10680.pts-4.wl (Detached)
1 Socket in /tmp/screens/S-root.
root@wl ~ # screen -r 10680.pts-4.wl
nohup 대선 사용해도 되겠다고 생각했다면 screen의 작동 방식을 이해한 셈이다.
Ctrl+a,? 도움말 Ctrl+a,c 새로운 윈도우 생성 Ctrl+a,SPACE (next) Advance to next window (with wraparound). Ctrl+a,Ctrl+a 바로 전에 선택된 윈도우로 스위치 Ctrl+a,0~9 0~9번 윈도우로 스위치 Ctrl+a,w 상태라인에 윈도우 이름 출력 Ctrl+a,a Ctrl+a를 실행중인 프로세스로 보냄 Ctrl+a,s Ctrl+s를 실행중인 프로세스로 보냄 Ctrl+a,q Ctrl+q를 실행중인 프로세스로 보냄 Ctrl+a,l 윈도우 다시 그림 Ctrl+a,W 80 또는 132 컬럼 모드 선택(토글) Ctrl+a,L 윈도우의 utmp-slot. Ctrl+a,z 스크린 대기. 셸에서 Ctrl+Z 를 누른것과 동일 Ctrl+a,x 스크린 잠금. 스크린을 다시 보려면 사용자의 패스워드를 입력해야 함. Ctrl+a,H (log) Log stdout of window n to screenlog.n. Ctrl+a,Ctrl+[ 카피 모드 시작. h,j,k,l로 커서 옮김. SPACE 또는 y로 완료. ESC로 취소 Ctrl+a,Ctrl+] 현재 윈도우의 stdin 으로 붙이기. Ctrl+a,< /tmp/screen-exchange에서 복사 버퍼로 읽음 Ctrl+a,> 복사 버퍼에서 /tmp/screen-exchange으로 씀 Ctrl+a,A 현재 윈도우의 타이틀을 변경. Ctrl+a,d screen 접속을 끊음. 이후에 다시 접속할 수 있다. 프로그램은 여전히 실행중이다. Ctrl+a,D 접속 종료 후 셸까지 종료 Ctrl+a,K 현재창을 종료하고 실행중인 프로세스에는 SIGHUP 시그널 보냄 Ctrl+a,: 온라인상태에서 설정 다시 읽음? Ctrl+a,S 화면 수평 분할 Ctrl+a,TAB 분할된 화면 토글 Ctrl+a,Q 화면 분할 취소수직 분할 기능은 별도의 패치가 필요하다.
root@wl ~ # screen -S shar1 -t one다른 SSH 커넥션으로 접속해 아래와 같이 명령을 준다.
root@wl ~ # screen -list
There is a screen on:
12236.shar1 (Attached)
1 Socket in /tmp/screens/S-root.
root@wl ~ # screen -x -r 12236.shar1 -p one
양쪽에서 동일하게 데이터를 주고 받을 수 있는 것을 확인할 수 있다. 이 명령은 세션을 공유하는 것이지 윈도우를 공유하는 것이 아니다!
root@wl ~ # su - windy windy@wl ~ $ screen Cannot open your terminal '/dev/pts/8' - please check. windy@wl ~ $ w root pts/8 4시02분오후 w
|
|
Copyright © 2004-2012 Jo HoSeok. All rights reserved. |