<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kristian Lunde &#187; GNU</title>
	<atom:link href="http://www.klunde.net/tag/gnu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.klunde.net</link>
	<description>www.klunde.net</description>
	<lastBuildDate>Sun, 18 Jul 2010 21:00:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using GNU screen</title>
		<link>http://www.klunde.net/2008/05/27/using-gnu-screen/</link>
		<comments>http://www.klunde.net/2008/05/27/using-gnu-screen/#comments</comments>
		<pubDate>Tue, 27 May 2008 20:14:18 +0000</pubDate>
		<dc:creator>Kristian Lunde</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[GNU]]></category>

		<guid isPermaLink="false">http://www.klunde.net/?p=25</guid>
		<description><![CDATA[
			
				
			
		
Recently I&#8217;ve been the victim of a really unstable internet connection. This lack of stability has made me a great fan of the GNU screen command in unix systems.
GNU Screen is a small piece of software that lets you initiate a number of terminals inside a single terminal window. The great advantage with screen is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F05%2F27%2Fusing-gnu-screen%2F" onclick="urchinTracker('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.klunde.net_2F2008_2F05_2F27_2Fusing-gnu-screen_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F05%2F27%2Fusing-gnu-screen%2F&amp;source=kristianlunde&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently I&#8217;ve been the victim of a really unstable internet connection. This lack of stability has made me a great fan of the GNU screen command in unix systems.</p>
<p>GNU Screen is a small piece of software that lets you initiate a number of terminals inside a single terminal window. The great advantage with screen is that if you loose your internet connection, the screen terminals and operations inside these terminals still run on the server, contrary to operations running directly on the terminal window of your external server.</p>
<p>Screen is real simple and in most cases you only need a few important commands:</p>
<ul>
<li>starting a session</li>
<li>listing all running sessions</li>
<li>attaching to a session</li>
<li>de attaching from a session</li>
<li>killing a session</li>
</ul>
<h3>Creating a new screen session</h3>
<p><strong>Command:</strong> <em>screen</em></p>
<pre>kristian@Saturn:~$ screen </pre>
<p><strong>Example:</strong></p>
<h3>Listing all active screen sessions</h3>
<p><strong>Command:</strong><em> screen -ls</em></p>
<p><strong>Example:</strong></p>
<div class="geshi no bash">
<div class="head">kristian@Saturn:~$ screen -ls</div>
<ol>
<li class="li1">
<div class="de1">There are screens on:</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11179</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11114</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">2</span> Sockets <span class="kw1">in</span> <span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>screen<span class="sy0">/</span>S-kristian.</div>
</li>
</ol>
</div>
<h3>Attaching to a session</h3>
<p>If only one screen session is active the command below will take you directly to the session. If there are several sessions running the command below will display a list of running sessions. To choose one of them the screen -r command has to be followed by the session name.</p>
<p><strong>Command: </strong><em>screen -r</em></p>
<p><strong>Example of several screen sessions running:</strong></p>
<div class="geshi no bash">
<div class="head">kristian@Saturn:~$ screen -r</div>
<ol>
<li class="li1">
<div class="de1">There are several suitable screens on:</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11179</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11114</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">Type <span class="st0">&quot;screen [-d] -r [pid.]tty.host&quot;</span> to resume one of them.</div>
</li>
</ol>
</div>
<p><strong>Example of attaching to a screen session:</strong></p>
<pre lang="bash">kristian@Saturn:~$ screen -r 11179.pts-0.Saturn</pre>
<h3>De attaching from a session</h3>
<p>De attaching from a screen session is real simple just remember the key combinations <img src='http://www.klunde.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Hold the<strong> CTRL</strong> key down, press<strong> A</strong>, then<strong> D</strong>. Thats it.</p>
<h3>Killing a screen session</h3>
<p>Killing a session is as simple as de attaching from one, just use the correct key combinations.</p>
<p>Keep the <strong>CTRL</strong> button down, press <strong>A</strong>, then <strong>K</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.klunde.net/2008/05/27/using-gnu-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
