Changes

Screen - Virtual Terminals From Console

2,712 bytes added, 13:11, 11 February 2008
The following lines were added (+) and removed (-):
<big>In other words: multiple virtual terminals from one terminal (like a remote shell), with the ability to detach processes and leave them running even when you disconnect!</big><big>In other words: multiple virtual terminals from one terminal (like a remote shell), with the ability to detach processes and leave them running even when you disconnect!* Always use screen and never loose your work by an interrupted Internet connection!!!</big>::: '''N''' &nbsp; next console::: '''C''' &nbsp; new console::: '''N''' &nbsp; next console::: '''D''' &nbsp; Manually detach from session (same as disconnecting while screen is running)::: ''']''' &nbsp; Paste copied text from other session<big>'''Screen Sessions'''</big>This is the real beauty of screen.  You are working within your virtual console, very busy, and your terminal session is lost, disconnected!  With screen you can log back into the remote system and pick up where you left off!Starting 'screen' without command line arguments starts a new screen session. screenAfter reconnecting to your shell, you can find and control existing sessions  screen -ls* lists currently running sessions  screen -r sessionname* attatch to a specific session by name  screen -x -r sessionname* attatch to a specific session by name again allowing multiple attachments to a session  screen -R* reattach if it can, or start a new session.      screen -D -RR* detach defunct client and attach current to first available sessionExample:SSH into a remote shell where we left screen sessions running detached.At the command prompt we type 'screen -ls' and see something like the following: [user@host home]$ screen -ls There are screens on:        26942.pts-0.host    (Detached)        4938.pts-0.host    (Detached)        5361.pts-0.host    (Detached) 3 Sockets in /tmp/uscreens/S-home.So we want to attach to one of the sessions and pick up were we left off.  Lets attach to the first one in the list by typing 'screen -r 26942'.  Notice it is not necessary to enter the .pts-0.host portion. <big>'''The Screen Scrollback Buffer'''</big>* enter copy mode with Ctrl-A [ or via the copy command* Arrow keys and Page Up/Down navigates.  Vi nav also works.* / and ? for vi-style search* Ctrl-S and Ctrl-R for incremental search* spacebar to mark text to copy and to mark copy end point* Ctrl-A ] to paste copied text into other session<big>'''screenrc'''</big>When screen is invoked, it executes initialization commands from the files `.screenrc' in the user's home directory and `/usr/local/etc/screenrc'. These defaults can be overridden in the following ways: For the global screenrc file screen searches for the environment variable $SYSSCREENRC (this override feature may be disabled at compile-time). The user specific screenrc file is searched for in $SCREENRC, then `$HOME/.screenrc'. The command line option `-c' specifies which file to use.The text scrollback buffer in screen is limited to 100 lines by default.  Adding the following to the screenrc file will increase that to a reasonable amount:  defscrollback 1024
Bureaucrat, administrator
16,195
edits