The Complete GNU Screen Reference Card ====================================== based on the GNU Screen Quick Reference Card by Ahmad Fahad Al-Twaijiry, ahmadt@gmail.com completed by Sven Guckes, screen@guckes.net Latest change: Fri Feb 17 08:29:13 CET 2006 ---------------------------------------------------------------------- Startup: ---------------------------------------------------------------------- $ screen --help 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 .sockname instead of ... -t title Set title. (window's name). -T term Use term as $TERM for windows, rather than "screen". (missing in manual!) -U Tell screen to use UTF-8 encoding. -v Print "Screen version 4.00.02 (FAU) 5-Dec-03". -wipe Do nothing, just clean up SockDir. -x Attach to a not detached screen. (Multi display mode). -X Execute as a screen command in the specified session. also described in the manual: -d -r Reattach a session and if necessary detach it first. -d -R Reattach a session and if necessary detach or even create it first. -d -RR Reattach a session and if necessary detach or create it. Use the first session if more than one session is available. -D -r Reattach a session. If necessary detach and logout remotely first. -D -R Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the user. This is the author's favorite. -D -RR Attach here and now. Whatever that means, just do it. -f -fn -fa -d -m -D -m -ls owner/ -r owner/ $ screen -d -r Detach *the* running session (if not already detached) and then reattach to *the* detached session $ screen -e^oo Start a session with escape character CTRL-O and use an 'o' to pass on an CTRL-O to the process inside the current window. helpful shell aliases: $ alias '?'='screen -ls' $ alias '!'='screen -r' ---------------------------------------------------------------------- multiuser mode: ---------------------------------------------------------------------- # chmod +s /usr/bin/screen # screen must be suid root: # chmod 755 /var/run/screen # screen dir must be 755 turn on multiuser mode for screen session: :multiuser on add username for viewing: :acladd username change permission for username to read-only for all windows (#) and all commands (?): :aclchg username +r-wx "#?" user can now see this session with: $ screen -ls guckes/ --------------------------------------------------------------------- notation: Control-A == CTRL-A == C-a == ^A default binding: command name: C-a C-\ quit Kill all windows and terminate screen. C-a " select Prompt for a window identifier and switch. C-a ' windowlist ... ---------------------------------------------------------------------- C-a Tab focus Switch the input focus downwards to the next region (split screen). C-a C-a other Toggle to the window displayed previously. C-a a meta Send the command/escape/meta character (C-a) to the process in current window. C-a A title Allow the user to enter a title for the current window. C-a b or C-b break ... C-a B pow_break ... C-a c or C-c screen Create a new window with a shell and switch to that window. C-a C clear Clear the screen. C-a d or C-d detach Detach screen from this terminal. C-a D pow_detach Detach and logout. C-a e or E or C-e free! todo: C-a f or F or C-f ... ... C-a g or G or C-g ... ... C-a h or C-h ... ... C-a H log Toggle logging of the current window to the file "screenlog.n". C-a i or I or C-i ... ... C-a j or J or C-j ... ... C-a k or C-k ... ... C-a K kill Destroy the current window. C-a l or L or C-l ... ... C-a m lastmsg Repeat the last message displayed in the message line. C-a M monitor Toggle monitoring of the current window. C-a C-m C-m ... ... C-a n or C-n next Switch to the next window. C-a N number Show the number (and title) of the current window. C-a o or O or C-o ... ... C-a p or C-p prev Switch to the previous window. C-a P ... ... C-a q C-q ... ... C-a Q only Delete all regions but the current one. C-a r or R or C-r ... ... C-a s or C-s ... ... C-a S split Split the current region into two new ones. C-a T or C-t ... ... C-a t time uptime C-a u or U or C-u ... ... C-a v or V or C-v ... ... C-a W or C-w ... ... C-a w windows Show a list of active windows. C-a C-x ... ... C-a x lockscreen Lock your terminal. C-a X remove Kill the current region. C-a y or Y or C-y ... ... C-a z or Z or C-z ... ... C-a [ or C-[ or ESC copy Enter copy/scrollback mode. C-a C-] or ] paste Write the contents of the paste buffer to the stdin queue of the current window. more synonyms: C-a space next Command Line only: resize [(+/-/=)lines] Resize the current region. all 53 command names: break clear colon copy detach digraph displays dumptermcap fit flow focus hardcopy help history info kill lastmsg license log login meta monitor next number only other pow_break pow_detach prev quit readbuf redisplay remove removebuf reset screen select silence split suspend time title vbell version width windows wrap writebuf xoff xon (missing: lockscreen paste windowlist) not yet described in list above: break colon digraph displays dumptermcap fit flow hardcopy help history info license login pow_break readbuf redisplay removebuf reset silence suspend vbell version width wrap writebuf xoff xon === default key bindings (listed by command name) break ^B b clear C colon : copy ^[ [ detach ^D d digraph ^V displays * dumptermcap . fit F flow ^F f focus ^I hardcopy h help ? history { } info i kill K k lastmsg ^M m license , log H login L meta x monitor M next ^@ ^N sp n number N only Q other ^X pow_break B pow_detach D prev ^H ^P p ^? quit \ readbuf < redisplay ^L l remove X removebuf = reset Z screen ^C c select " ' silence _ split S suspend ^Z z time ^T t title A vbell ^G version v width W windows ^W w wrap ^R r writebuf > xoff ^S s xon ^Q q ^] paste . - 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 I login on O login off ] paste . ===============================================EOF