{"id":771,"date":"2011-05-11T07:42:41","date_gmt":"2011-05-11T07:42:41","guid":{"rendered":"http:\/\/www.esds.co.in\/data-centers\/kb\/?p=771"},"modified":"2015-06-22T11:09:23","modified_gmt":"2015-06-22T11:09:23","slug":"using-the-screen-command-for-linux","status":"publish","type":"post","link":"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/","title":{"rendered":"Using The Screen Command For Linux"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-773\" title=\"Linux Screen Command Tutorial\" alt=\"\" src=\"http:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/05\/Linux-Screen-Command-Tutorial.jpg\" width=\"675\" height=\"226\" srcset=\"https:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/05\/Linux-Screen-Command-Tutorial.jpg 675w, https:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/05\/Linux-Screen-Command-Tutorial-300x100.jpg 300w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/p>\n<p>Before starting, I&#8217;ll tell you what we can do by using the screen command.<\/p>\n<p>As a Linux sysadmin, it is very common that you have the need to run several commands at once. You will probably open several ssh sessions for this, however, there is a way better, safer and recommended.<\/p>\n<p>Another need that will arise frequently, is to run a command or script that will take hours to complete, such as an rsync. This requires that you keep the connection open on ssh, because if you close, the script or command also will close, which can be a problem if you have your Internet connection interrupted.<\/p>\n<p>Given these problems, we can begin to introduce you to the command screen.<\/p>\n<p>Screen &#8211; makes it possible to run several pseudo terminals, manipulate and save your entries and exits on the screen, and copy and paste between windows.<\/p>\n<p>I&#8217;ll show you how to run a command that takes hours, within one screen.<\/p>\n<p>We will first install screen, using yum, apt-get, or use a package manager that you have available. In our example we will use yum.<\/p>\n<p><code>yum install screen<\/code><\/p>\n<p>Now type:<\/p>\n<p><code>Screen<\/code><\/p>\n<p>This command will start a new window within the screen for you. You also have the option to launch the command window giving a name (parameter-S). Example:<\/p>\n<p><code>screen-S gracious 1<\/code><\/p>\n<p>In this case, the window will be called &#8220;gracious 1.<\/p>\n<p>The screen works like any other within the ssh session. You can now enter any command that will run normally.<\/p>\n<p>If you want to exit the screen session, leaving it active, and maintain the command that was running, do:<\/p>\n<p><code>Ctrl-a d (control + the press release, and then press d)<\/code><\/p>\n<p>So when you want to re-screen window, type:<\/p>\n<p><code>screen-r<\/code><\/p>\n<p>Other options you have when you are inside the screen are:<\/p>\n<p>1. To create a new session:<\/p>\n<p><code>Ctrl-a c<\/code><\/p>\n<p>2. To change between sessions:<\/p>\n<p><code>Ctrl-a n<\/code><\/p>\n<p>There are other possibilities of use. For more information and help, you can use in your terminal:<\/p>\n<p><code>man screen<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before starting, I&#8217;ll tell you what we can do by using the screen command. As a Linux sysadmin, it is very common that you have the need to run several commands at once. You will probably open several ssh sessions for this, however, there is a way better, safer and recommended. Another need that will [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[325,324],"class_list":["post-771","post","type-post","status-publish","format-standard","hentry","category-general","tag-linux-sysadmin","tag-screen-command-linux"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.9.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using The Screen Command For Linux | Linux Screen Command Tutorial<\/title>\n<meta name=\"description\" content=\"Using The Screen Command For Linux is the knowledgebase tutorial for major problems on a server. In this article we will teach you how to correctly identify the consultations (queries) that are causing problems for the server.\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using The Screen Command For Linux | Linux Screen Command Tutorial\" \/>\n<meta property=\"og:description\" content=\"Using The Screen Command For Linux is the knowledgebase tutorial for major problems on a server. In this article we will teach you how to correctly identify the consultations (queries) that are causing problems for the server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"ESDS Official Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ESDSdc\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-05-11T07:42:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-06-22T11:09:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/05\/Linux-Screen-Command-Tutorial.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ESDSDataCenter\" \/>\n<meta name=\"twitter:site\" content=\"@ESDSDataCenter\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/#website\",\"url\":\"https:\/\/www.esds.co.in\/kb\/\",\"name\":\"ESDS Official Knowledgebase\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.esds.co.in\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/05\/Linux-Screen-Command-Tutorial.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/#webpage\",\"url\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/\",\"name\":\"Using The Screen Command For Linux | Linux Screen Command Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/#primaryimage\"},\"datePublished\":\"2011-05-11T07:42:41+00:00\",\"dateModified\":\"2015-06-22T11:09:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/#\/schema\/person\/d951a1b6843822458f3c5f5ee02a74e8\"},\"description\":\"Using The Screen Command For Linux is the knowledgebase tutorial for major problems on a server. In this article we will teach you how to correctly identify the consultations (queries) that are causing problems for the server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/\",\"url\":\"https:\/\/www.esds.co.in\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/\",\"url\":\"https:\/\/www.esds.co.in\/kb\/using-the-screen-command-for-linux\/\",\"name\":\"Using The Screen Command For Linux\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/#\/schema\/person\/d951a1b6843822458f3c5f5ee02a74e8\",\"name\":\"ESDS ADMIN\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/60adc2c4f4d067fa8bb7e682c0fea80e7ee189ca0fe84d805689918516372073?s=96&d=mm&r=g\",\"caption\":\"ESDS ADMIN\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts\/771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/comments?post=771"}],"version-history":[{"count":13,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts\/771\/revisions"}],"predecessor-version":[{"id":2783,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts\/771\/revisions\/2783"}],"wp:attachment":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/categories?post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/tags?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}