{"id":49,"date":"2016-06-19T22:54:24","date_gmt":"2016-06-19T20:54:24","guid":{"rendered":"http:\/\/www.forlex.it\/blog\/?p=49"},"modified":"2016-06-19T22:54:24","modified_gmt":"2016-06-19T20:54:24","slug":"screen","status":"publish","type":"post","link":"http:\/\/www.forlex.it\/index.php\/2016\/06\/19\/screen\/","title":{"rendered":"Screen"},"content":{"rendered":"<p>In realt\u00e0 Screen ( <a href=\"http:\/\/www.gnu.org\/software\/screen\/\">http:\/\/www.gnu.org\/software\/screen\/<\/a>&nbsp;) non \u00e8 un windows manager ma si comporta come tale. Altro non \u00e8 che un wrapper per le sessioni di terminale in uso. Questo applicativo permette la gestione delle sessioni, di conseguenza si ha la possibilit\u00e0 di usare un terminale, sospenderlo e riprenderne l&#8217;uso quando si&nbsp;ha necessit\u00e0.<\/p>\n<p>Un esempio : &nbsp;Devo&nbsp;copiare,&nbsp;utilizzando come console un collegamento&nbsp;ssh, il contenuto di un&nbsp;hard disk in&nbsp;un&#8217;altra unit\u00e0 di memoria. L&#8217;ingente quantit\u00e0 promette tempi di copiatura vicini alle 12 ore, cosa faccio ? lancio la copia ed aspetto ?&nbsp;Uso Screen, apro una sessione lancio il comando, la sospendo e ne aprio un&#8217;altra ed ecco che posso continuare a lavorare.<\/p>\n<p>Come si usa :&nbsp;In realt\u00e0 screen ha tanti comandi ma, come mio solito, vi indicher\u00f2 i pi\u00f9 utili.<\/p>\n<p>Per lanciare una sessione di screen useremo il comando<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: courier new,courier;\">screen -S &lt;nomesessione&gt;<\/span><\/p>\n<p>per sganciarla, tenendo sempre attivo il task che ho avviato devo realizzare il &#8220;detach&#8221; con &#8220;<strong>Ctrl-A d<\/strong>&#8221; mentre per ri-agganciarla useremo<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: courier new,courier;\">screen -r &lt;nomesessione&gt;<\/span><\/p>\n<p>nel caso in cui avessi aperto la sessione dal computer A e mi spostassi sul computer B, volendo continuare ad usare &#8220;quella&#8221; sessione potr\u00f2 lanciare<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: courier new,courier;\">screen -dr &lt;nomesessione&gt;&nbsp;<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; che sgancer\u00e0 (detach) la sessione gi\u00e0 inizializata con l&#8217;altro terminale e la riaggancer\u00e0 con il nostro &#8220;<span style=\"text-decoration: underline;\">senza perdere la sessone di lavoro<\/span>&#8220;<\/p>\n<p>&nbsp;per vedere l&#8217;elenco delle sessioni aperte<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: courier new,courier;\">screen -ls<\/span><\/p>\n<p>In caso voleste aprire pi\u00f9 terminale all&#8217;interno della stessa sessione potrete usare il comando &#8220;<strong>Ctrl-A c<\/strong>&#8221; in questo modo sar\u00e0 un p\u00f2 come essere dinanzi al&nbsp;monitor del computer e poter quindi switchare fra i diversi terminali.&nbsp;Per avere un elenco dei&nbsp;terminali aperti, all&#8217;interno della stessa sessione screen, digitiamo&nbsp;:<\/p>\n<p style=\"padding-left: 30px;\"><strong>Ctrl-A &#8220;<\/strong> &lt;&#8211; virgolette<\/p>\n<p>che restituisce un elenco dei terminali&nbsp;selezionabili con tasti freccia ed enter.<\/p>\n<p>Per uscire da una sessione screen digitiamo &#8220;exit&#8221; seguito da invio.<\/p>\n<p>I resto dei comandi potrete scoprirli con il sempre presente &#8211;help<\/p>\n<p style=\"padding-left: 30px;\">\u00a0<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In realt\u00e0 Screen ( http:\/\/www.gnu.org\/software\/screen\/&nbsp;) non \u00e8 un windows manager ma si comporta come tale. Altro non \u00e8 che un wrapper per le sessioni di terminale in uso. Questo applicativo permette la gestione delle sessioni, di conseguenza si ha la &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.forlex.it\/index.php\/2016\/06\/19\/screen\/\"> <span class=\"screen-reader-text\">Screen<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/posts\/49"}],"collection":[{"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":1,"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":50,"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/posts\/49\/revisions\/50"}],"wp:attachment":[{"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.forlex.it\/index.php\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}