{"id":767,"date":"2021-01-08T11:59:29","date_gmt":"2021-01-08T11:59:29","guid":{"rendered":"https:\/\/www.velaninfo.com\/rs\/?post_type=techtips&#038;p=767"},"modified":"2021-01-08T11:59:29","modified_gmt":"2021-01-08T11:59:29","slug":"how-to-use-linux-screen","status":"publish","type":"techtips","link":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/","title":{"rendered":"How to Use Linux Screen"},"content":{"rendered":"<p><strong>How to Use Linux Screen?<\/strong><\/p>\n<p>Screen is a terminal multiplexer. Any number of Windows (virtual terminals) can be started inside a session. Processes will continue to run even when the window is not visible or when you get disconnected. Screen utility allows you to run long running tasks and resume the sessions even when you get disconnected or SSH session is terminated.<\/p>\n<p>These days the screen package is available in most of the Linux distros. The following command checks if Screen is installed and the version of Screen.<\/p>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # screen \u2013version<\/em><\/p>\n<p>The output for the command is as follows \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-768\" src=\"https:\/\/www.velaninfo.com\/rs\/wp-content\/uploads\/2021\/01\/Untitled.png\" alt=\"Linux Screen\" width=\"567\" height=\"95\" \/><\/p>\n<p><strong>Installation of Screen:<\/strong><\/p>\n<p>The following commands installs screen on your server<\/p>\n<p><strong>Ubuntu and Debian based distros<\/strong><\/p>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # apt update<\/em><\/p>\n<p><em># apt install screen<\/em><\/p>\n<p><strong>CentOS and Fedora based distros<\/strong><\/p>\n<p><em># yum update<\/em><\/p>\n<p><em># yum install screen<\/em><\/p>\n<p>To start screen session, type the following command<\/p>\n<p><em># screen<\/em><\/p>\n<p>To open screen session with a specific name<\/p>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # screen \u2013S name<\/em><\/p>\n<p>You can run multiple windows in a single screen session.<\/p>\n<p>To create a new windows with shell, type Ctrl+a c, the first available number from the range of 0..9 will be assigned.<\/p>\n<p>The following are the most common commands for managing Linux Screen window<\/p>\n<ul>\n<li>Ctrl+a\u00a0c\u00a0Create a new window (with shell)<\/li>\n<li>Ctrl+a\u00a0&#8221;\u00a0List all window<\/li>\n<li>Ctrl+a\u00a00\u00a0Switch to window 0 (by number )<\/li>\n<li>Ctrl+a\u00a0A\u00a0Rename the current window<\/li>\n<li>Ctrl+a\u00a0S\u00a0Split current region horizontally into two regions<\/li>\n<li>Ctrl+a\u00a0|\u00a0Split current region vertically into two regions<\/li>\n<li>Ctrl+a\u00a0tab\u00a0Switch the input focus to the next region<\/li>\n<li>Ctrl+a\u00a0Ctrl+a\u00a0Toggle between the current and previous region<\/li>\n<li>Ctrl+a\u00a0Q\u00a0Close all regions but the current one<\/li>\n<li>Ctrl+a\u00a0X\u00a0Close the current region<\/li>\n<\/ul>\n<p><strong>\u00a0<\/strong><strong>Detach from screen session:<\/strong><\/p>\n<p><em># Ctrl+a d<\/em> will detach the session. Tasks running in screen will continue after detaching from the session.<\/p>\n<p><strong>Reattach screen session:<\/strong><\/p>\n<p><em># screen \u2013ls<\/em> command will show the list of screen sessions running.<\/p>\n<p>The output for the command is as follows \u2013<\/p>\n<p><em>There are screens on:<\/em><\/p>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10225.example\u00a0\u00a0 (Detached)<\/em><\/p>\n<p><em>10599.nodejs\u00a0\u00a0 (Detached)<\/em><\/p>\n<p><em>2 Sockets in \/run\/screens\/tracker<\/em><\/p>\n<p>The following command attaches to the existing screen session.<\/p>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # screen \u2013r 10225.example<\/em><\/p>\n<p>Steps to get Screen started<\/p>\n<ol>\n<li>Type screen on the command prompt<\/li>\n<li>Run the desired program<\/li>\n<li>Use Ctrl-a+Ctrl-d to detach from the screen session<\/li>\n<li>Type screen-r to reattach to the screen session<\/li>\n<\/ol>\n<p>At <strong>Velan<\/strong>, our server support engineers can help you install screen utility and monitor the time consuming tasks remotely on your server. We troubleshoot problems like these for our clients every day.\u00a0If you are interested in our service, please fill the <a href=\"https:\/\/www.velaninfo.com\/contact\"><strong>Quick connect<\/strong><\/a> form to get in touch with us<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Use Linux Screen? Screen is a terminal multiplexer. Any number of Windows (virtual terminals) can be started inside a session. Processes will continue to run even when the window is not visible or when you get disconnected. Screen utility allows you to run long running tasks and resume the sessions even when you&#8230;<a class=\"continue-reading text-uppercase\" href=\"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/\"> Continue Reading <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.velaninfo.com\/rs\/wp-content\/themes\/velaninfo\/images\/reading_arw.png\" alt=\"Continue Reading\" width=\"16\" height=\"12\"\/><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"tags":[],"class_list":["post-767","techtips","type-techtips","status-publish","hentry","Categories_tech_tip-linux","Categories_tech_tip-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v19.5 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use Linux Screen | Velan<\/title>\n<meta name=\"description\" content=\"Steps on how to install Screen utility and how to use it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Linux Screen\" \/>\n<meta property=\"og:description\" content=\"Steps on how to install Screen utility and how to use it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/\" \/>\n<meta property=\"og:site_name\" content=\"Velan\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.velaninfo.com\/rs\/wp-content\/uploads\/2021\/01\/Untitled.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\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\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/\",\"url\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/\",\"name\":\"How to Use Linux Screen | Velan\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Untitled.png\",\"datePublished\":\"2021-01-08T11:59:29+00:00\",\"description\":\"Steps on how to install Screen utility and how to use it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Untitled.png\",\"contentUrl\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Untitled.png\",\"width\":567,\"height\":95,\"caption\":\"Linux Screen\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-use-linux-screen\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tech Tips\",\"item\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Use Linux Screen\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/#website\",\"url\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/\",\"name\":\"Velan\",\"description\":\"Velaninfo Services India Pvt Ltd\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use Linux Screen | Velan","description":"Steps on how to install Screen utility and how to use it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Linux Screen","og_description":"Steps on how to install Screen utility and how to use it.","og_url":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/","og_site_name":"Velan","og_image":[{"url":"https:\/\/www.velaninfo.com\/rs\/wp-content\/uploads\/2021\/01\/Untitled.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/","url":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/","name":"How to Use Linux Screen | Velan","isPartOf":{"@id":"https:\/\/www.velaninfo.com\/rs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/#primaryimage"},"image":{"@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/#primaryimage"},"thumbnailUrl":"https:\/\/www.velaninfo.com\/rs\/wp-content\/uploads\/2021\/01\/Untitled.png","datePublished":"2021-01-08T11:59:29+00:00","description":"Steps on how to install Screen utility and how to use it.","breadcrumb":{"@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/#primaryimage","url":"https:\/\/www.velaninfo.com\/rs\/wp-content\/uploads\/2021\/01\/Untitled.png","contentUrl":"https:\/\/www.velaninfo.com\/rs\/wp-content\/uploads\/2021\/01\/Untitled.png","width":567,"height":95,"caption":"Linux Screen"},{"@type":"BreadcrumbList","@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-use-linux-screen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.velaninfo.com\/rs\/"},{"@type":"ListItem","position":2,"name":"Tech Tips","item":"https:\/\/www.velaninfo.com\/rs\/techtips\/"},{"@type":"ListItem","position":3,"name":"How to Use Linux Screen"}]},{"@type":"WebSite","@id":"https:\/\/www.velaninfo.com\/rs\/#website","url":"https:\/\/www.velaninfo.com\/rs\/","name":"Velan","description":"Velaninfo Services India Pvt Ltd","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.velaninfo.com\/rs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips\/767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips"}],"about":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/types\/techtips"}],"author":[{"embeddable":true,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/comments?post=767"}],"version-history":[{"count":1,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips\/767\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips\/767\/revisions\/769"}],"wp:attachment":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/media?parent=767"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/tags?post=767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}