{"id":1582,"date":"2015-01-14T03:21:29","date_gmt":"2015-01-14T03:21:29","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=1582"},"modified":"2015-01-14T03:21:29","modified_gmt":"2015-01-14T03:21:29","slug":"using-screen","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/14\/using-screen\/","title":{"rendered":"Using screen"},"content":{"rendered":"\n<p>The screen program is a powerful terminal multiplexer for Unix-like operating systems such as Linux. It allows you to create multiple virtual terminals within a single terminal window or remote session, which can be detached and reattached as needed, even if the original terminal session is disconnected.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Using screen, you can run multiple command-line applications or shell sessions within a single terminal window, allowing you to switch between them easily and even leave them running in the background while you work on other tasks. This can be particularly useful when working on remote systems or when you need to keep long-running processes running in the background.<\/p>\n\n\n\n<p>Some of the key features of screen include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Multiple virtual terminals within a single terminal window.<\/li>\n\n\n\n<li>Detachable and reattachable sessions, even across different machines.<\/li>\n\n\n\n<li>Built-in support for session logging and monitoring.<\/li>\n\n\n\n<li>Customizable key bindings and configuration options.<\/li>\n\n\n\n<li>Overall, screen is a versatile and powerful tool that can be very useful for managing multiple terminal sessions and keeping long-running processes running smoothly.<\/li>\n<\/ul>\n\n\n\n<p>Now we know what it is, let&#8217;s install it.<\/p>\n\n\n\n<p>For Alma\/Rocky<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndnf config-manager --set-enabled powertools\ndnf install epel-release\n<\/pre><\/div>\n\n\n<p>For Debian\/Ubuntu<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum install epel-release\n<\/pre><\/div>\n\n\n<p>Now , let&#8217;s install screen<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nyum install screen -y\n<\/pre><\/div>\n\n\n<p>Once installed, here are some basic commands to use the screen program:<\/p>\n\n\n\n<p>Start a new session: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nscreen\n<\/pre><\/div>\n\n\n<p>Start a new session with a custom name: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nscreen -S session_name\n<\/pre><\/div>\n\n\n<p>Detach from a session: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nCtrl + A then d\n<\/pre><\/div>\n\n\n<p>List active sessions: <\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nscreen -ls\n<\/pre><\/div>\n\n\n<p>Reattach to a session: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nscreen -r session_id\n<\/pre><\/div>\n\n\n<p>Kill a session: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nscreen -X -S session_id quit\n<\/pre><\/div>\n\n\n<p>Once you are in a screen session, you can create new windows by pressing <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nCtrl + A then c\n<\/pre><\/div>\n\n\n<p>You can switch between windows by pressing <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nCtrl + A then n (next) or p (previous)\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>The screen program is a powerful terminal multiplexer for Unix-like operating systems such as Linux. It allows you to create multiple virtual terminals within a single terminal window or remote session, which can be detached and reattached as needed, even if the original terminal session is disconnected.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1582","post","type-post","status-publish","format-standard","hentry","category-administration"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=1582"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1582\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=1582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=1582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=1582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}