Skip to main content

gnome screen

screen

nano editor에서 빠져나오기
C+x가 screen prefix 일 경우, nano 에디터에서 빠쪄나오기 어렵다. 이때는 C+t, C+z하면 background 처리한 후, kill 명령어로 nano 실행 프로세스를 죽여야 한다.
 
 
그리고 crontab -e를 실행할 때,
export VISUAL=vim; crontab -e로 실행해라.
 
 


screen session title를 변경 원할 경우
C+x, shift+a 하면 각 창 제목을 변경할 수 있다.

 
 


user's manual
http://www.delorie.com/gnu/docs/screen/screen_toc.html


- Run a new screen session
# screen


- Reattach to a previously detatched session
# screen -R


- Create a new window.
# '''prefix''' c


- Kill the current window - after confirmation
# '''prefix''' k

- 현재 창의 창 번호를 변경하는 방법
예 창번호 3에서 1로 변경할 경우, 먼저 창 3으로 이동한 상태에서
# '''prefix''' :number 1 [enter]하면 창번호3이 1로 변경됨. 


- Switch to the other window
# '''prefix''' space


- Detach & Attach
screen を起動した状態で、
# Ctrl-z d or Ctrl-z ^D
とすると、screenを起動する前のシェルに戻ります。screenはバックグランドで動いています。これを「Detachedデタッチ」と言います。
Attachedとは「再開」


デタッチしたセッションを確認するには、
# screen -ls


There are screens on:
        9407.pts-10.sdadev3     (Detached)
        9281.pts-8.sdadev3      (Detached)
        9174.pts-4.sdadev3      (Detached)
        9088.pts-3.sdadev3      (Attached)
4 Sockets in /var/run/screen/S-suninno.




数字の9407がセッション番号です。この後、ログアウトしたとしてもセッションは維持されます。デタッチされたセッションを呼び出すには、


# screen -r 9407




とします。924の部分はセッション番号を書きます。セッションをscreen -lsで確認したときに1つだけしかなければ、セッション番号は省略できます。


別の場所でアタッチされているセッションに接続する時には、あらかじめデタッチします。オプション -d を付けると接続が切れます。


# screen -d 9088
# screen -r 927
アタッチされているセッションに、さらにアタッチする。


# screen -x 924


window splits


-Split the current window in two.
# '''prefix''' S




- Move between split sections of the screen.
# '''prefix''' TAB




- 現在の領域以外を消す
# '''prefix''' Q




- 現在の領域を消す
# '''prefix''' X




- Give the the current window a name.
# '''prefix''' A




- List all windows - move around to change the window with the arrow eys        
# '''prefix''' a "







copy and paste


prefix [
으로, navigation mode로 변환 한다.
이동방법은 vi키바인딩으로 가능
복사를 원하는 위치에 가서 space키를 누른 후,
복사 종료 위치에 가서 다시 한번 space키를 누르면, buffer에 복사된다.


paste를 원하는 위치에 이동하여, prefix ]하면
stdin으로 출력된다.




  • 스크린 세션 설정하기
$> screen -S "세션명"

예제>
$> screen -S "temp2"
bighave@bighave-desktop:~$ screen -ls
There are screens on:
        11386.temp2     (2024년 11월 27일 07시 19분 54초)       (Detached)


또는
screen 기동상태에서
Ctrl-escape :sessionname "새로운 세션명"
으로 변경 가능함





.screenrc 파일

defencoding utf-8

# Prefix
escape ^Xx

startup_message off

autodetach on


# logging
log on
deflog on
logfile "~/log/screen-%Y%m%d-%n.log"


defscrollback 3000

hardstatus alwayslastline "%{= rw} %H %{= wk}%-Lw%{= bw}%n%f* %t%{= wk}%+Lw %{= wk}%=%{= gk} %y/%m/%d %c "



- install
$ sudo apt-get isntall screen




- more informations
http://news.softpedia.com/news/GNU-Screen-Tutorial-44274.shtml
http://www.rubyist.net/~rubikitch/computer/screen/
http://d.hatena.ne.jp/aircastle/20080501/1209641600

Comments

Popular posts from this blog

Linux Resources Monitoring

dstat Requirements:python Dstat is a versatile replacement for iostat, vmstat and ifstat http://linux.softpedia.com/get/System/Diagnostics/Dstat-1401.shtml  - download the source file  - tar -xvjf dstate-0.7.2.tar.bz2  - cd dstate-0.7.2  - sudo make install 사용법 dstat -cdngys --top-io-adv --top-bio-adv 창넓이가 크면 dstat -cdngys --top-io --top-bio dstat 기본옵션은 -cdngy 2. pktstat requirements: libpcap-devel, ncurses-devel pktstat man page 사용법:sudo pktstat -i eth0 -T -l 실행결과 interface: eth0    total: 43.9Mb (3s) cur: 12.3M (78%) min: 12.3M max: 15.8M avg: 14.5M bps    bps    %      b desc   1.4k   0%   4.3k arp  591.8   0%   1.2k ip proto 88 55.101.66.3 <-> igrp-routers  91.3k   0%  91.3k tcp a100236:4478 <-> console:ssh  42.6k   0% 216.4k tcp a100390:mailprox <-> console:ssh   1.1k   0%   ...

nginx로 다중 포트 설정 및 다중 react app 설정

nginx에 다중 포트 설정하기 react로 여러 webapp를 개발하고, 동일한 서버에 실행시킬 필요가 있다. 이때 간단히 nginx에서 다중포트로 여러 webapp를 동일한 서버에서 실행시킬 수 있다. /etc/nginx/sites-available/에 default 파일이 있다. 보통 port 80로 설정되어 있다. 이 파일을 복사해서 sub로 명명한다.   아래와 같이 포트 8080으로 정하고, react app를 build한 디렉터리를 root <dir>로 지정하고, $> sudo service nginx restart 하면 된다. $>sudo systemctl status nginx.service 로 nginx 상태 확인이 가능하면, $> netstat -ano | grep 8080 으로 8080 포트가 살아있는 또는 외부PC에서  $>telnet ip 8080으로 telnet 접속이 되는지 확인하면 된다. 종종 Nginx 500 Interval Server Error가 발생하는데, 이는 1) root <dir>에서 <dir> 주소가 정확하지 않거나, 2) 파일 권한이 없거나이다. chmod 755 <dir>하면 대부분 해결될 것이다. 그럼 오늘도 유익한 하루 되시길..   

SQLITE Result Codes

#define SQLITE_OK 0 /* Successful result */ /* beginning-of-error-codes */ #define SQLITE_ERROR 1 /* SQL error or missing database */ #define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ #define SQLITE_PERM 3 /* Access permission denied */ #define SQLITE_ABORT 4 /* Callback routine requested an abort */ #define SQLITE_BUSY 5 /* The database file is locked */ #define SQLITE_LOCKED 6 /* A table in the database is locked */ #define SQLITE_NOMEM 7 /* A malloc() failed */ #define SQLITE_READONLY 8 /* Attempt to write a readonly database */ #define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ #define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ #define SQLITE_CORRUPT 11 /* The database disk image is malformed */ #define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */ #define SQLITE_FULL 13 /* Insertion failed because data...