GNU Screen In Linux

Overview

Screen is a handy which runs on top of terminal itself. This means allows you to create with in a terminal and each session are self contained.

A feature that I use of screen is the detachable feature. Each is attachable. Once it has been detached you return to your original shell and can exit / logout but the would still be running as long as the computer itself is still running. You can log back on later and reattach to the and continue from where you left of. This gives you the ability to run long , detach the session and come back to it later when it has finished.

Basics

In you have to install screen first:
sudo apt-get install screen

When is started it loads a fresh terminal. To do screen commands it is usually these keyboard key combinations:
ctrl+a
Followed by a key or typing a command.

To start screen:
screen

It is always advisable to name your sessions with a name. This can be done with the -t argument. For example
screen -t formatUSB

The screen session can also be named within the session itself:
ctrl+a
:sessionname formatUSB

To “detach” a screen and come back to it later use:
ctrl+a d
This will through you back to your original terminal before you started screen. What ever you left running in Screen is still running in the background.

To get back into your Screen terminal use the command screen -r If you only have 1 screen running it will attach that Screen. However if you have multiple Screens you can list the screens running using the argument -ls e.g screen -ls This is where naming your screen sessions comes in handy otherwise they are just a process number and a few other Linux environment variable thrown into the name. Using the normal attach arugment but parse it the name to reattach to a specific screen e.g screen -r formatUSB

Here’s a cool way of splitting the terminal in Linux using Screen. It allows you to have a two terminals open at the same time and displayed at the same time with the ability to tab between them. It is possible to split them up multiple times but I have found two was enough.

Horizontal Split Screen

For a horizontal split do the following keyboard shortcuts:
ctrl+a shift+s
Split the screem
ctrl+a tab
Tab to the lower screen
ctrl+a c
Create a new screen

Use ctrl+a tab to switch between the upper and lower screens. Each screen can be further split by doing the same combinations again. The key combination seems odd because I associate ctrl+a as select all.

Vertical & horizontal split for man screen Article from CodeSnippets

Related posts:

  1. Ubuntu 8.10 – The Pain
  2. Starting A Program From Command Line to X
  3. Bypass Blocked Websites Using SSH Proxy
  4. VirtualBox With Ubuntu Quick Review
  5. Ubuntu No Monitor Defaults To 800×600

About Danny

Young I.T software professional always studying and applying the knowledge gained and one way to do this is blogging. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny is now in the industry that he has aimed since leaving school. View all posts by Danny → This entry was posted in Linux, Software and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

*

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.