ScreenCommand

From UABgrid Documentation
(Difference between revisions)
Jump to: navigation, search
(added screen command intro)
 
(added screen cli options)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
As the [http://www.gnu.org/software/screen/manual/screen.html man page] states,  Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). A process (shell or command like ls) can be attached to the screen command/session. The screen session won't die or exit until terminated by the attached command/shell. This is useful when SSH connections are opened over flaky network connections. Screen can multiplex commands into a single window so it makes it convenient to open new shell sessions in the same window.
+
As the [http://www.gnu.org/software/screen/manual/screen.html man page] states,  Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). A process (shell or command like ls) can be attached to the screen command/session. The screen session won't die or exit until terminated by the attached command/shell. This is useful when working over a flaky network connection. Screen can multiplex commands into a single window so it makes it convenient to open new shell sessions in the same window.
  
 
== Starting a screen session ==
 
== Starting a screen session ==
Line 6: Line 6:
 
screen -S screen-getting-started
 
screen -S screen-getting-started
 
</pre>
 
</pre>
 +
 +
== Screen control keystrokes ==
 +
{| class="wikitable"
 +
|-
 +
! Action !! Keystroke
 +
|-
 +
| Help menu || Ctrl-a ?
 +
|-
 +
| Version || Ctrl-a v
 +
|-
 +
| List windows || Ctrl-a w
 +
|-
 +
| Scroll through windows || Ctrl-a Ctrl-a
 +
|-
 +
| Rename window session || Ctrl-a A
 +
|-
 +
| Detach from the screen session || Ctrl-a d
 +
|}
 +
 +
== Screen command options ==
 +
{| class="wikitable"
 +
|-
 +
! Action !! Option
 +
|-
 +
| List screen sessions || screen -list or screen -ls
 +
|-
 +
| Reattach to a screen session || screen -r <session-name>
 +
|}
  
 
== Adding configuration options to screenrc file ==
 
== Adding configuration options to screenrc file ==

Latest revision as of 11:38, 26 September 2013

As the man page states, Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). A process (shell or command like ls) can be attached to the screen command/session. The screen session won't die or exit until terminated by the attached command/shell. This is useful when working over a flaky network connection. Screen can multiplex commands into a single window so it makes it convenient to open new shell sessions in the same window.

Contents

[edit] Starting a screen session

You can start a new screen session just by typing 'screen' command. You can name your screen session using -S option as follows:

screen -S screen-getting-started

[edit] Screen control keystrokes

Action Keystroke
Help menu Ctrl-a ?
Version Ctrl-a v
List windows Ctrl-a w
Scroll through windows Ctrl-a Ctrl-a
Rename window session Ctrl-a A
Detach from the screen session Ctrl-a d

[edit] Screen command options

Action Option
List screen sessions screen -list or screen -ls
Reattach to a screen session screen -r <session-name>

[edit] Adding configuration options to screenrc file

You can customize screen settings using command-line options or by creating a screenrc file. See Customization section in the man page for detailed options. See Red Hat magazine article for examples.

[edit] Logging screen window to a screenlog file

Screen can log it's window output to a screenlog file. This can be done by invoking screen with -L option.

[edit] Viewing screenlog file

Screen log file contains escape characters and hence it's not directly human readable. You can get pretty output using less command with -R or -r options. See stackoverflow answers for hints.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox