Hits : 7993
Last Edit: 29.07.2015 13:53

Screen – Terminal :: Mini How To 


Home Page of screen


http://www.gnu.org/software/screen


Manual


http://www.delorie.com/gnu/docs/screen/screen_toc.html


top


Download latest version


ftp://ftp.gnu.org/pub/gnu/screen/


top


Quick Installation


wget -c ftp://ftp.gnu.org/pub/gnu/screen/screen-4.0.3.tar.gz
tar zxvf screen-4.0.3.tar.gz 
cd screen-4.0.3/
./configure --prefix=/usr/local/
make
make install


top


English Description


Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows. When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off, copy text between windows, view the scrollback history, switch between windows, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.


top


Greek Description


Η εντολή screen είναι ένα πρόγραμμα με το οποίο μπορούμε να ανοίξουμε εικονικές
τερματικές συνδέσεις σε ένα και μόνο τερματικό παράθυρο. Έτσι ενώ έχουμε κάνει
μόνο μία φορά Login μπορούμε να εργαστούμε σε περισσότερες από μία κονσόλες
στο ίδιο σύστημα. Είναι ένα αρκετά χρήσιμο εργαλείο το οποίο μας βοηθάει όταν
κάνουμε πολλές δουλείες ταυτόχρονα στο ίδιο σύστημα ή θέλουμε να παρακολουθήσουμε
τα αποτελέσματα των αλλαγών μας από ένα άλλο τερματικό


top


How to use screen


# screen


Ctrl a c Creates a new screen session so that you can use more than one screen session at once.
Ctrl a n Switches to the next screen session (if you use more than one).
Ctrl a p Switches to the previous screen session (if you use more than one).
Ctrl a d Detaches a screen session (without killing the processes in it – they continue).
Ctrl + a + '' Εμφάνιση λίστας των τερματικών screen

top


Παραδείγματα Χρήσης

Πως να ανοίξουμε 3 τερματικά μέσα από μία κονσόλα


# screen 
# ssh ebalaskas@ebalaskas.gr
# ctrl+a+c
# ssh ebal@balinux.otenet.gr
# ctrl+a+c
# ssh ebal@ebal.otenet.gr
# ctrl + a + p
# ctrl + a + p
# ctrl + a + n
# ctrl + a + ''
# ctrl + a + A
    name_of_terminal

Πως κάνουμε re-attach


η παρακάτω εντολή κάνει de-attach πρώτα από την προηγούμενη κονσόλα μας
και έπειτα re-attache του session στην νέα μας κονσόλα.


# screen -d -r

Split


Horizontal


Ctrl + a + S


Vertical


Ctrl + a + |

browsing through windows


ctrl + a + tab

resizing window


eg.


ctrl + a
:resize +10

Πως βλέπουμε ολόκληρο το ιστορικό ενός τερματικού


ctrl + a + esc


top


screenrc


# ebal
caption always "%{= 11}%{+b w}Screen: %n | %h %=%t %c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
activity "Activity in %t(%n)"

bindkey "^[<" eval number !echo $WINDOW-1|bc
bindkey "^[>" eval number !echo $WINDOW+1|bc
bindkey "^[," prev
bindkey "^[." next

Ημερομηνία στην τελευταία γραμμή


hardstatus on
hardstatus alwayslastline "%w, %c:%s %d/%m/%Y"

Functions Keys


bindkey -k k7 prev
bindkey -k k8 next
bindkey -k F2 quit


top


Manual


Use: screen [-opts] [cmd [args]]
 or: screen -r [host.tty]
 
Options:
-a            Force all capabilities into each window's termcap.
-A -[r|R]     Adapt all windows to the new display width & height.
-c file       Read configuration file instead of '.screenrc'.
-d (-r)       Detach the elsewhere running screen (and reattach here).
-dmS name     Start as daemon: Screen session in detached mode.
-D (-r)       Detach and logout remote (and reattach here).
-D -RR        Do whatever is needed to get a screen session.
-e xy Change command characters.
-f            Flow control on, -fn = off, -fa = auto.
-h lines      Set the size of the scrollback history buffer.
-i            Interrupt output sooner when flow control is on.
-l            Login mode on (update /var/run/utmp), -ln = off.
-list         or -ls. Do nothing, just list our SockDir.
-L            Turn on output logging.
-m            ignore $STY variable, do create a new screen session.
-O            Choose optimal output rather than exact vt100 emulation.
-p window     Preselect the named window if it exists.
-q            Quiet startup. Exits with non-zero return code if unsuccessful.
-r            Reattach to a detached screen process.
-R            Reattach if possible, otherwise start a new session.
-s shell      Shell to execute rather than $SHELL.
-S sockname   Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title      Set title. (window's name).
-T term       Use term as $TERM for windows, rather than "screen".
-U            Tell screen to use UTF-8 encoding.
-v            Print "Screen version 3.09.15 (FAU) 13-Mar-03".
-wipe         Do nothing, just clean up SockDir.
-x            Attach to a not detached screen. (Multi display mode).
-X            Execute <cmd> as a screen command in the specified session.

top


screen help


ctrl+A+?


Command key:  ^A   Literal ^A:  a  
  break       ^B b license,                 removebuf   =         
  clear       C lockscreen  ^X x reset       Z colon       :            log H screen      °C c copy        ^[ [         login       L select      '         
  detach      ^D d meta        a silence     _         
  digraph     ^V           monitor     M split       S displays    *            next        ^@ ^N sp n   suspend     ^Z z dumptermcap .            number      N time        ^T t fit         F only        Q title       A flow        °F f other       ^A           vbell       ^G        
  focus       ^I           pow_break   B version     v hardcopy    h pow_detach  D width       W help        ?            prev        ^H ^P p ^?   windows     ^W w history     { }          quit        ^\           wrap        ^R r info        i readbuf     <            writebuf    >         
  kill        °K k redisplay   ^L l xoff        ^S s lastmsg     ^M m remove      X xon         ^Q q  
^]  paste .
"   windowlist -b
–   select –
0   select 0
1   select 1
2   select 2
3   select 3
4   select 4
5   select 5
6   select 6
7   select 7
8   select 8
9   select 9
]   paste .