🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 14 (from laksa042)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
1 month ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH1.4 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.redhat.com/en/blog/tips-using-screen
Last Crawled2026-02-28 07:57:13 (1 month ago)
First Indexed2024-11-20 10:48:11 (1 year ago)
HTTP Status Code200
Meta TitleTips for using screen
Meta DescriptionWhat happens when you’re connected to a remote system, using a long-running program, and then the connection drops? The odds are, at a minimum, you’re go...
Meta Canonicalnull
Boilerpipe Text
What happens when you’re connected to a remote system, using a long-running program, and then the connection drops? The odds are, at a minimum, you’re going to have to restart the program, and in a worst-case scenario, you’ll have data corruption. To help get around this, some programs run in a window shell on the system. A very basic example of this is the screen program: [pgervase@pgervase ~]$ ssh root@rhel7dev.usersys.redhat.com X11 forwarding request failed on channel 0 Last login: Wed Jan 27 12:10:06 2021 from xxxxxxxx.redhat.com [root@rhel7dev ~]# screen This opens my new shell on the rhel7dev system. I’ll run the ping command below from inside of that session: [root@rhel7dev ~]# ping www.google.com PING www.google.com (74.125.24.147) 56(84) bytes of data. 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=1 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=2 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=3 ttl=100 time=242 ms I’ll now demonstrate how to detach from the session to simulate a network outage or to simply leave something running overnight. To do this, I hit Ctrl , hold that key down, then hit A , then hit D . That brings me back to the default SSH prompt and I am then able to run screen -ls to see my detached session: [root@rhel7dev ~]# screen -x [detached from 25665.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There is a screen on:     25665.pts-0.rhel7dev    (Detached) 1 Socket in /var/run/screen/S-root. [root@rhel7dev ~]# [ You might also enjoy:  Working with pipes on the Linux command line ] To resume my screen session, I type screen -x because there was only one session as an option. That brought me back to the screen session where the ping command is still running: [root@rhel7dev ~]# ping www.google.com PING www.google.com (74.125.24.147) 56(84) bytes of data. 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=1 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=2 ttl=100 time=242 ms <snipped> 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=19 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=20 ttl=100 time=242 ms ^C --- www.google.com ping statistics --- 20 packets transmitted, 20 received, 0% packet loss, time 20278ms rtt min/avg/max/mdev = 242.105/242.197/242.727/0.576 ms [root@rhel7dev ~]# I can have multiple screen sessions at once: [root@rhel7dev ~]# screen -ls There is a screen on:     25665.pts-0.rhel7dev    (Detached) 1 Socket in /var/run/screen/S-root. [root@rhel7dev ~]# screen [detached from 25693.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There are screens on:     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 2 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# screen [detached from 25706.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There are screens on:     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 3 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# In each of those three screen sessions, I can have commands running or simply leave a session sitting at the prompt. A default screen -x will not work to resume a session now because of the multiple screens running: [root@rhel7dev ~]# screen -x There are several suitable screens on:     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) Type "screen [-d] -r [pid.]tty.host" to resume one of them. [root@rhel7dev ~]# To attach to one of my sessions, I need to run screen -x and add enough of the screen name to be unique: [root@rhel7dev ~]# screen -x 257 [detached from 25706.pts-0.rhel7dev] [root@rhel7dev ~]# Rather than trying to limit yourself to just one session or remembering what is running on which screen, you can set a name for the session by using the -S argument: [root@rhel7dev ~]# screen -S "db upgrade" [detached from 25778.db upgrade] [root@rhel7dev ~]# screen -ls There are screens on:     25778.db upgrade    (Detached)     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 4 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# screen -x "db upgrade" [detached from 25778.db upgrade] [root@rhel7dev ~]# To exit a screen session, you can type exit or hit Ctrl+A and then D . Now that you know how to start, stop, and label screen sessions let's get a little more in-depth. To split your screen session in half vertically hit Ctrl+A and then the | key ( Shift+Backslash ). At this point, you’ll have your screen session with the prompt on the left: To switch to your screen on the right, hit Ctrl+A and then the Tab key. Your cursor is now in the right session, but there’s no prompt. To get a prompt hit Ctrl+A and then C . I can do this multiple times to get multiple vertical splits to the screen: You can now toggle back and forth between the two screen panes by using Ctrl+A+Tab . What happens when you cat out a file that’s larger than your console can display and so some content scrolls past? To scroll back in the buffer, hit Ctrl+A and then Esc . You’ll now be able to use the cursor keys to move around the screen and go back in the buffer. There are other options for screen , so to see them, hit Ctrl , then A , then the question mark : [ Free online course: Red Hat Enterprise Linux technical overview . ]  Further reading can be found in the man page for screen . This article is a quick introduction to using the screen command so that a disconnected remote session does not end up killing a process accidentally. Another program that is similar to screen is tmux and you can read about tmux in this article .
Markdown
[Skip to content](https://www.redhat.com/en/blog/tips-using-screen#rhdc-main-content) ## Navigation Menu AI - ### Our approach - [News and insights](https://www.redhat.com/en/blog/channel/artificial-intelligence) - [Technical blog](https://developers.redhat.com/aiml#ai-ml-main-tab-recent-articles-100491) - [Research](https://www.redhat.com/en/artificial-intelligence/research) - [Live AI events](https://www.redhat.com/en/events/ai) - [Get an overview](https://www.redhat.com/en/artificial-intelligence) - ### Products - [Red Hat AI Enterprise](https://www.redhat.com/en/products/ai/enterprise) - [Red Hat AI Inference Server](https://www.redhat.com/en/products/ai/inference-server) - [Red Hat Enterprise Linux AI](https://www.redhat.com/en/products/ai/enterprise-linux-ai) - [Red Hat OpenShift AI](https://www.redhat.com/en/products/ai/openshift-ai) - [Explore Red Hat AI](https://www.redhat.com/en/products/ai) - ### Engage & learn - [AI learning hub](https://docs.redhat.com/en/learn/ai) - [AI partners](https://catalog.redhat.com/categories/ai#ai-partners) - [Services for AI](https://www.redhat.com/en/services/consulting/red-hat-consulting-for-ai) Hybrid cloud - ### Platform solutions - [Artificial intelligence](https://www.redhat.com/en/hybrid-cloud-solutions/ai) Build, deploy, and monitor AI models and apps. - [Linux standardization](https://www.redhat.com/en/hybrid-cloud-solutions/linux-standardization) Get consistency across operating environments. - [Application development](https://www.redhat.com/en/hybrid-cloud-solutions/application-development) Simplify the way you build, deploy, and manage apps. - [Automation](https://www.redhat.com/en/hybrid-cloud-solutions/automation) Scale automation and unite tech, teams, and environments. - ### Use cases - [Virtualization](https://www.redhat.com/en/hybrid-cloud-solutions/virtualization) Modernize operations for virtualized and containerized workloads. - [Digital sovereignty](https://www.redhat.com/en/products/digital-sovereignty) Control and protect critical infrastructure. - [Security](https://www.redhat.com/en/solutions/trusted-software-supply-chain) Code, build, deploy, and monitor security-focused software. - [Edge computing](https://www.redhat.com/en/products/edge) Deploy workloads closer to the source with edge technology. - [Explore solutions](https://www.redhat.com/en/hybrid-cloud-solutions) - ### Solutions by industry - [Automotive](https://www.redhat.com/en/solutions/automotive) - [Financial services](https://www.redhat.com/en/solutions/financial-services) - [Healthcare](https://www.redhat.com/en/solutions/healthcare) - [Industrial sector](https://www.redhat.com/en/solutions/industrial-sector) - [Media and entertainment](https://www.redhat.com/en/solutions/media-entertainment) - [Public sector (Global)](https://www.redhat.com/en/solutions/public-sector) - [Public sector (U.S.)](https://www.redhat.com/en/solutions/public-sector/us) - [Telecommunications](https://www.redhat.com/en/solutions/telecommunications) ### [Discover cloud technologies](https://www.redhat.com/en/hybrid-cloud-console) Learn how to use our cloud products and solutions at your own pace in the Red Hat® Hybrid Cloud Console. Products - ### Platforms - [Red Hat AI](https://www.redhat.com/en/products/ai) Develop and deploy AI solutions across the hybrid cloud. - [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) Support hybrid cloud innovation on a flexible operating system. - [Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) Build, modernize, and deploy apps at scale. - [Red Hat Ansible Automation Platform](https://www.redhat.com/en/technologies/management/ansible) Implement enterprise-wide automation. - ### Featured - [Red Hat OpenShift Virtualization Engine](https://www.redhat.com/en/technologies/cloud-computing/openshift/virtualization-engine) - [Red Hat OpenShift Service on AWS](https://www.redhat.com/en/technologies/cloud-computing/openshift/aws) - [Microsoft Azure Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift/azure) - [See all products](https://www.redhat.com/en/technologies/all-products) - ### Try & buy - [Start a trial](https://www.redhat.com/en/products/trials) - [Buy online](https://www.redhat.com/en/store) - [Integrate with major cloud providers](https://www.redhat.com/en/partners/certified-cloud-and-service-providers) - ### Services & support - [Consulting](https://www.redhat.com/en/services/consulting) - [Product support](https://www.redhat.com/en/services/support) - [Services for AI](https://www.redhat.com/en/services/consulting/red-hat-consulting-for-ai) - [Technical Account Management](https://www.redhat.com/en/services/support/technical-account-management) - [Explore services](https://www.redhat.com/en/services) Training - ### Training & certification - [Courses and exams](https://www.redhat.com/en/services/training/all-courses-exams) - [Certifications](https://www.redhat.com/en/services/certifications) - [Skills assessments](https://skills.ole.redhat.com/en) - [Red Hat Academy](https://www.redhat.com/en/services/training/red-hat-academy) - [Learning subscription](https://www.redhat.com/en/services/training/learning-subscription) - [Explore training](https://www.redhat.com/en/services/training-and-certification) - ### Featured - [Red Hat Certified System Administrator exam](https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam) - [Red Hat System Administration I](https://www.redhat.com/en/services/training/rh124-red-hat-system-administration-i) - [Red Hat Learning Subscription trial (No cost)](https://www.redhat.com/en/services/training/learning-subscription/trial) - [Red Hat Certified Engineer exam](https://www.redhat.com/en/services/training/ex294-red-hat-certified-engineer-rhce-exam-red-hat-enterprise-linux) - [Red Hat Certified OpenShift Administrator exam](https://www.redhat.com/en/services/training/red-hat-certified-openshift-administrator-exam) - ### Services - [Consulting](https://www.redhat.com/en/services/consulting) - [Partner training](https://connect.redhat.com/en/training) - [Product support](https://www.redhat.com/en/services/support) - [Services for AI](https://www.redhat.com/en/services/consulting/red-hat-consulting-for-ai) - [Technical Account Management](https://www.redhat.com/en/services/support/technical-account-management) Learn - ### Build your skills - [Documentation](https://docs.redhat.com/en) - [Hands-on labs](https://www.redhat.com/en/interactive-labs) - [Hybrid cloud learning hub](https://cloud.redhat.com/learn) - [Interactive learning experiences](https://www.redhat.com/en/interactive-experiences) - [Training and certification](https://www.redhat.com/en/services/training-and-certification) - ### More ways to learn - [Blog](https://www.redhat.com/en/blog) - [Events and webinars](https://www.redhat.com/en/events) - [Podcasts and video series](https://www.redhat.com/en/red-hat-original-series) - [Red Hat TV](https://tv.redhat.com/) - [Resource library](https://www.redhat.com/en/resources) ### [For developers](https://developers.redhat.com/) Discover resources and tools to help you build, deliver, and manage cloud-native applications and services. Partners - ### For customers - [Our partners](https://www.redhat.com/en/partners) - [Red Hat Ecosystem Catalog](https://catalog.redhat.com/) - [Find a partner](https://catalog.redhat.com/partners) - ### For partners - [Partner Connect](https://connect.redhat.com/) - [Become a partner](https://connect.redhat.com/en/benefits-of-being-a-partner) - [Training](https://connect.redhat.com/en/training) - [Support](https://connect.redhat.com/en/support) - [Access the partner portal](https://connect.redhat.com/partner-admin/dashboard) ### [Build solutions powered by trusted partners](https://catalog.redhat.com/en/solutions) Find solutions from our collaborative community of experts and technologies in the Red Hat® Ecosystem Catalog. Search ### I'd like to: - [Start a trial](https://www.redhat.com/en/products/trials) - [Buy a learning subscription](https://www.redhat.com/en/services/training/learning-subscription/how-to-buy) - [Manage subscriptions](https://access.redhat.com/management) - [Contact sales](https://www.redhat.com/en/contact) - [Contact customer service](https://www.redhat.com/en/contact/customer-service) - [See Red Hat jobs](https://www.redhat.com/en/jobs) ### Help me find: - [Documentation](https://docs.redhat.com/en) - [Developer resources](https://developers.redhat.com/) - [Tech topics](https://www.redhat.com/en/topics) - [Architecture center](https://www.redhat.com/architect/portfolio/) - [Security updates](https://access.redhat.com/security/security-updates/cve) - [Support cases](https://access.redhat.com/support/cases) ### I want to learn more about: - [AI](https://www.redhat.com/en/topics/ai) - [Application modernization](https://www.redhat.com/en/topics/application-modernization) - [Automation](https://www.redhat.com/en/topics/automation) - [Cloud-native applications](https://www.redhat.com/en/topics/cloud-native-apps) - [Linux](https://www.redhat.com/en/topics/linux) - [Virtualization](https://www.redhat.com/en/topics/virtualization) [Console](https://www.redhat.com/en/hybrid-cloud-console) [Docs](https://docs.redhat.com/en) [Support](https://access.redhat.com/) New For you ### Recommended We'll recommend resources you may like as you browse. Try these suggestions for now. - [Product trial center](https://www.redhat.com/en/products/trials) - [Courses and exams](https://www.redhat.com/en/services/training/all-courses-exams) - [All products](https://www.redhat.com/en/technologies/all-products) - [Tech topics](https://www.redhat.com/en/topics) - [Resource library](https://www.redhat.com/en/resources) Log in ### Get more with a Red Hat account - Console access - Event registration - Training & trials - World-class support A subscription may be required for some services. [Log in or register](https://sso.redhat.com/) Change page language [Contact us](https://www.redhat.com/en/contact) ### \[\[name\]\] [Edit avatar](https://access.redhat.com/user/edit) Login: \[\[login\]\] Account number: \[\[account\_number\]\] \[\[email\]\] Change page language Log out [Red Hat Blog](https://www.redhat.com/en/blog) - [By product]() - [Red Hat AI](https://www.redhat.com/en/blog/channel/red-hat-ai "Red Hat AI") - [Red Hat Ansible Automation Platform](https://www.redhat.com/en/blog/channel/red-hat-ansible-automation "Red Hat Ansible Automation Platform") - [Red Hat Enterprise Linux](https://www.redhat.com/en/blog/channel/red-hat-enterprise-linux "Red Hat Enterprise Linux") - [Red Hat OpenShift](https://www.redhat.com/en/blog/channel/red-hat-openshift "Red Hat OpenShift") *** [More products](https://www.redhat.com/en/blog/products "More products") - [By topic]() - [AI](https://www.redhat.com/en/blog/channel/artificial-intelligence "AI") - [Virtualization](https://www.redhat.com/en/blog/channel/red-hat-virtualization "Virtualization") - [Digital sovereignty](https://www.redhat.com/en/blog/channel/digital-sovereignty "Digital sovereignty") - [Applications](https://www.redhat.com/en/blog/channel/applications "Applications") - [Automation](https://www.redhat.com/en/blog/channel/management-and-automation "Automation") - [Cloud services](https://www.redhat.com/en/blog/channel/cloud-services "Cloud services") - [Edge computing](https://www.redhat.com/en/blog/channel/edge-computing "Edge computing") - [Infrastructure](https://www.redhat.com/en/blog/channel/infrastructure "Infrastructure") - [Open hybrid cloud](https://www.redhat.com/en/blog/channel/hybrid-cloud-infrastructure "Open hybrid cloud") - [Original shows](https://www.redhat.com/en/red-hat-original-series "Original shows") - [Security](https://www.redhat.com/en/blog/channel/security "Security") *** [All topics](https://www.redhat.com/en/blog/channels "All topics") - [Podcasts]() - [Technically Speaking with Chris Wright](https://www.redhat.com/en/technically-speaking "Technically Speaking with Chris Wright") - [Code Comments](https://www.redhat.com/en/code-comments-podcast "Code Comments") - [Command Line Heroes](https://www.redhat.com/en/command-line-heroes "Command Line Heroes") - [Compiler](https://www.redhat.com/en/compiler-podcast "Compiler") - [More blogs]() - [Red Hat Developer blog](https://developers.redhat.com/blog "Red Hat Developer blog") - [Red Hat Partner Connect blog](https://connect.redhat.com/en/blog "Red Hat Partner Connect blog") # Tips for using screen March 3, 2021[Peter Gervase](https://www.redhat.com/en/authors/pgervase "See more by Peter Gervase")*3*\-minute read [Linux](https://www.redhat.com/en/blog?f[0]=taxonomy_topic_tid:27061#rhdc-search-listing) Share Subscribe to RSS - [Back to all posts](https://www.redhat.com/en/blog) *** What happens when you’re connected to a remote system, using a long-running program, and then the connection drops? The odds are, at a minimum, you’re going to have to restart the program, and in a worst-case scenario, you’ll have data corruption. To help get around this, some programs run in a window shell on the system. A very basic example of this is the `screen` program: ``` [pgervase@pgervase ~]$ ssh root@rhel7dev.usersys.redhat.com X11 forwarding request failed on channel 0 Last login: Wed Jan 27 12:10:06 2021 from xxxxxxxx.redhat.com [root@rhel7dev ~]# screen ``` This opens my new shell on the `rhel7dev` system. I’ll run the `ping` command below from inside of that session: ``` [root@rhel7dev ~]# ping www.google.com PING www.google.com (74.125.24.147) 56(84) bytes of data. 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=1 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=2 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=3 ttl=100 time=242 ms ``` I’ll now demonstrate how to detach from the session to simulate a network outage or to simply leave something running overnight. To do this, I hit **Ctrl**, hold that key down, then hit **A**, then hit **D**. That brings me back to the default SSH prompt and I am then able to run `screen -ls` to see my detached session: ``` [root@rhel7dev ~]# screen -x [detached from 25665.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There is a screen on:     25665.pts-0.rhel7dev    (Detached) 1 Socket in /var/run/screen/S-root. [root@rhel7dev ~]# ``` ***\[ You might also enjoy: [Working with pipes on the Linux command line](https://www.redhat.com/sysadmin/pipes-command-line-linux) \]*** To resume my screen session, I type `screen -x` because there was only one session as an option. That brought me back to the screen session where the `ping` command is still running: ``` [root@rhel7dev ~]# ping www.google.com PING www.google.com (74.125.24.147) 56(84) bytes of data. 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=1 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=2 ttl=100 time=242 ms <snipped> 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=19 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=20 ttl=100 time=242 ms ^C --- www.google.com ping statistics --- 20 packets transmitted, 20 received, 0% packet loss, time 20278ms rtt min/avg/max/mdev = 242.105/242.197/242.727/0.576 ms [root@rhel7dev ~]# ``` I can have multiple screen sessions at once: ``` [root@rhel7dev ~]# screen -ls There is a screen on:     25665.pts-0.rhel7dev    (Detached) 1 Socket in /var/run/screen/S-root. [root@rhel7dev ~]# screen [detached from 25693.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There are screens on:     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 2 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# screen [detached from 25706.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There are screens on:     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 3 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# ``` In each of those three screen sessions, I can have commands running or simply leave a session sitting at the prompt. A default `screen -x` will not work to resume a session now because of the multiple screens running: ``` [root@rhel7dev ~]# screen -x There are several suitable screens on:     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) Type "screen [-d] -r [pid.]tty.host" to resume one of them. [root@rhel7dev ~]# ``` To attach to one of my sessions, I need to run `screen -x` and add enough of the screen name to be unique: ``` [root@rhel7dev ~]# screen -x 257 [detached from 25706.pts-0.rhel7dev] [root@rhel7dev ~]# ``` Rather than trying to limit yourself to just one session or remembering what is running on which screen, you can set a name for the session by using the `-S` argument: ``` [root@rhel7dev ~]# screen -S "db upgrade" [detached from 25778.db upgrade] [root@rhel7dev ~]# screen -ls There are screens on:     25778.db upgrade    (Detached)     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 4 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# screen -x "db upgrade" [detached from 25778.db upgrade] [root@rhel7dev ~]# ``` To exit a screen session, you can type `exit` or hit **Ctrl+A** and then **D**. Now that you know how to start, stop, and label `screen` sessions let's get a little more in-depth. To split your screen session in half vertically hit **Ctrl+A** and then the **\|** key (**Shift+Backslash**). At this point, you’ll have your screen session with the prompt on the left: [![Split screen feature of the screen command](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image3_0.png)](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image3_0.png) To switch to your screen on the right, hit **Ctrl+A** and then the **Tab** key. Your cursor is now in the right session, but there’s no prompt. To get a prompt hit **Ctrl+A** and then **C**. I can do this multiple times to get multiple vertical splits to the screen: [![Three split screens with the screen command](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image1_0.png)](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image1_0.png) You can now toggle back and forth between the two screen panes by using **Ctrl+A+Tab**. What happens when you `cat` out a file that’s larger than your console can display and so some content scrolls past? To scroll back in the buffer, hit **Ctrl+A** and then **Esc**. You’ll now be able to use the cursor keys to move around the screen and go back in the buffer. There are other options for `screen`, so to see them, hit **Ctrl**, then **A**, then the **question mark**: [![List of options for the screen command](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image2_0.png)](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image2_0.png) ***\[ Free online course: [Red Hat Enterprise Linux technical overview](https://www.redhat.com/en/services/training/rh024-red-hat-linux-technical-overview?intcmp=701f20000012ngPAAQ). \]*** Further reading can be found in the man page for `screen`. This article is a quick introduction to using the `screen` command so that a disconnected remote session does not end up killing a process accidentally. Another program that is similar to `screen` is `tmux` and you can read about `tmux` in [this article](https://www.redhat.com/sysadmin/tips-using-tmux). *** ### About the author [![Peter Gervase](https://www.redhat.com/rhdc/managed-files/styles/media_thumbnail/private/sysadmin/pictures/2020-10/PeterGervase_0.jpg?itok=lcTNOPDq)](https://www.redhat.com/en/authors/pgervase) [Peter Gervase](https://www.redhat.com/en/authors/pgervase) I am a Senior Principal Security Architect at Verizon. Before that, I worked at Red Hat in various roles such as consulting and in the Solutions Architect where I specialized in Smart Management, Ansible, and OpenShift. In my free time, I enjoy spending time with my family, exercising, and woodworking. [Read full bio](https://www.redhat.com/en/authors/pgervase) ## More like this Blog post ### [More than meets the eye: Behind the scenes of Red Hat Enterprise Linux 10 (Part 6)](https://www.redhat.com/en/blog/more-meets-eye-behind-scenes-red-hat-enterprise-linux-10-part-6) Blog post ### [More than meets the eye: Behind the scenes of Red Hat Enterprise Linux 10 (Part 5)](https://www.redhat.com/en/blog/more-meets-eye-behind-scenes-red-hat-enterprise-linux-10-part-5) Original podcast ### [Days of Future Open \| Command Line Heroes](https://www.redhat.com/en/command-line-heroes/season-1/days-of-future-open) Original podcast ### [The Overlooked Operating System \| Compiler: Stack/Unstuck](https://www.redhat.com/en/compiler-podcast/overlooked-operating-system) ## Browse by channel [Explore all channels](https://www.redhat.com/en/blog/channels "Explore all channels") ![automation icon](https://www.redhat.com/cms/managed-files/automation.svg) ### [Automation](https://www.redhat.com/en/blog/channel/management-and-automation) The latest on IT automation for tech, teams, and environments ![AI icon](https://www.redhat.com/cms/managed-files/AI.svg) ### [Artificial intelligence](https://www.redhat.com/en/blog/channel/artificial-intelligence) Updates on the platforms that free customers to run AI workloads anywhere ![open hybrid cloud icon](https://www.redhat.com/cms/managed-files/open-hybrid-cloud.svg) ### [Open hybrid cloud](https://www.redhat.com/en/blog/channel/hybrid-cloud-infrastructure) Explore how we build a more flexible future with hybrid cloud ![security icon](https://www.redhat.com/cms/managed-files/security.svg) ### [Security](https://www.redhat.com/en/blog/channel/security) The latest on how we reduce risks across environments and technologies ![edge icon](https://www.redhat.com/cms/managed-files/edge_2.svg) ### [Edge computing](https://www.redhat.com/en/blog/channel/edge-computing) Updates on the platforms that simplify operations at the edge ![Infrastructure icon](https://www.redhat.com/cms/managed-files/infrastructure.svg) ### [Infrastructure](https://www.redhat.com/en/blog/channel/infrastructure) The latest on the world’s leading enterprise Linux platform ![application development icon](https://www.redhat.com/cms/managed-files/application-development.svg) ### [Applications](https://www.redhat.com/en/blog/channel/applications) Inside our solutions to the toughest application challenges ![Virtualization icon](https://www.redhat.com/rhdc/managed-files/Icon-Red_Hat-Virtual_server-A-Black-RGB.svg) ### [Virtualization](https://www.redhat.com/en/blog/channel/red-hat-virtualization) The future of enterprise virtualization for your workloads on-premise or across clouds [![Red Hat logo](https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--on-dark.svg)](https://www.redhat.com/en) [LinkedIn](https://www.linkedin.com/company/red-hat) [YouTube](https://www.youtube.com/user/RedHatVideos) [Facebook](https://www.facebook.com/RedHat/) [X](https://twitter.com/RedHat) ### Platforms - [Red Hat AI](https://www.redhat.com/en/products/ai) - [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) - [Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) - [Red Hat Ansible Automation Platform](https://www.redhat.com/en/technologies/management/ansible) - [See all products](https://www.redhat.com/en/technologies/all-products) ### Tools - [Training and certification](https://www.redhat.com/en/services/training-and-certification) - [My account](https://www.redhat.com/wapps/ugc/protected/personalInfo.html) - [Customer support](https://access.redhat.com/) - [Developer resources](https://developers.redhat.com/) - [Find a partner](https://catalog.redhat.com/partners) - [Red Hat Ecosystem Catalog](https://catalog.redhat.com/) - [Documentation](https://docs.redhat.com/en) ### Try, buy, & sell - [Product trial center](https://www.redhat.com/en/products/trials) - [Red Hat Store](https://www.redhat.com/en/store) - [Buy online (Japan)](https://www.redhat.com/en/about/japan-buy) - [Console](https://www.redhat.com/en/hybrid-cloud-console) ### Communicate - [Contact sales](https://www.redhat.com/en/contact/sales) - [Contact customer service](https://www.redhat.com/en/contact/customer-service) - [Contact training](https://www.redhat.com/en/services/training-and-certification/contact-us) - [Social](https://www.redhat.com/en/about/social) ### About Red Hat Red Hat is an open hybrid cloud technology leader, delivering a consistent, comprehensive foundation for transformative IT and artificial intelligence (AI) applications in the enterprise. As a [trusted adviser to the Fortune 500](https://www.redhat.com/en/about/company), Red Hat offers cloud, developer, Linux, automation, and application platform technologies, as well as [award-winning](https://access.redhat.com/recognition) services. - [Our company](https://www.redhat.com/en/about/company) - [How we work](https://www.redhat.com/en/about/our-culture) - [Customer success stories](https://www.redhat.com/en/success-stories) - [Analyst relations](https://www.redhat.com/en/about/analysts) - [Newsroom](https://www.redhat.com/en/about/newsroom) - [Open source commitments](https://www.redhat.com/en/about/open-source) - [Our social impact](https://www.redhat.com/en/about/community-social-responsibility) - [Jobs](https://www.redhat.com/en/jobs) ### Change page language ### Red Hat legal and privacy links - [About Red Hat](https://www.redhat.com/en/about/company) - [Jobs](https://www.redhat.com/en/jobs) - [Events](https://www.redhat.com/en/events) - [Locations](https://www.redhat.com/en/about/office-locations) - [Contact Red Hat](https://www.redhat.com/en/contact) - [Red Hat Blog](https://www.redhat.com/en/blog) - [Inclusion at Red Hat](https://www.redhat.com/en/about/our-culture/inclusion) - [Cool Stuff Store](https://coolstuff.redhat.com/) - [Red Hat Summit](https://www.redhat.com/en/summit) © 2026 Red Hat ### Red Hat legal and privacy links - [Privacy statement](https://www.redhat.com/en/about/privacy-policy) - [Terms of use](https://www.redhat.com/en/about/terms-use) - [All policies and guidelines](https://www.redhat.com/en/about/all-policies-guidelines) - [Digital accessibility](https://www.redhat.com/en/about/digital-accessibility)
Readable Markdown
What happens when you’re connected to a remote system, using a long-running program, and then the connection drops? The odds are, at a minimum, you’re going to have to restart the program, and in a worst-case scenario, you’ll have data corruption. To help get around this, some programs run in a window shell on the system. A very basic example of this is the `screen` program: ``` [pgervase@pgervase ~]$ ssh root@rhel7dev.usersys.redhat.com X11 forwarding request failed on channel 0 Last login: Wed Jan 27 12:10:06 2021 from xxxxxxxx.redhat.com [root@rhel7dev ~]# screen ``` This opens my new shell on the `rhel7dev` system. I’ll run the `ping` command below from inside of that session: ``` [root@rhel7dev ~]# ping www.google.com PING www.google.com (74.125.24.147) 56(84) bytes of data. 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=1 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=2 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=3 ttl=100 time=242 ms ``` I’ll now demonstrate how to detach from the session to simulate a network outage or to simply leave something running overnight. To do this, I hit **Ctrl**, hold that key down, then hit **A**, then hit **D**. That brings me back to the default SSH prompt and I am then able to run `screen -ls` to see my detached session: ``` [root@rhel7dev ~]# screen -x [detached from 25665.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There is a screen on:     25665.pts-0.rhel7dev    (Detached) 1 Socket in /var/run/screen/S-root. [root@rhel7dev ~]# ``` ***\[ You might also enjoy: [Working with pipes on the Linux command line](https://www.redhat.com/sysadmin/pipes-command-line-linux) \]*** To resume my screen session, I type `screen -x` because there was only one session as an option. That brought me back to the screen session where the `ping` command is still running: ``` [root@rhel7dev ~]# ping www.google.com PING www.google.com (74.125.24.147) 56(84) bytes of data. 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=1 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=2 ttl=100 time=242 ms <snipped> 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=19 ttl=100 time=242 ms 64 bytes from 74.125.24.147 (74.125.24.147): icmp_seq=20 ttl=100 time=242 ms ^C --- www.google.com ping statistics --- 20 packets transmitted, 20 received, 0% packet loss, time 20278ms rtt min/avg/max/mdev = 242.105/242.197/242.727/0.576 ms [root@rhel7dev ~]# ``` I can have multiple screen sessions at once: ``` [root@rhel7dev ~]# screen -ls There is a screen on:     25665.pts-0.rhel7dev    (Detached) 1 Socket in /var/run/screen/S-root. [root@rhel7dev ~]# screen [detached from 25693.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There are screens on:     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 2 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# screen [detached from 25706.pts-0.rhel7dev] [root@rhel7dev ~]# screen -ls There are screens on:     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 3 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# ``` In each of those three screen sessions, I can have commands running or simply leave a session sitting at the prompt. A default `screen -x` will not work to resume a session now because of the multiple screens running: ``` [root@rhel7dev ~]# screen -x There are several suitable screens on:     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) Type "screen [-d] -r [pid.]tty.host" to resume one of them. [root@rhel7dev ~]# ``` To attach to one of my sessions, I need to run `screen -x` and add enough of the screen name to be unique: ``` [root@rhel7dev ~]# screen -x 257 [detached from 25706.pts-0.rhel7dev] [root@rhel7dev ~]# ``` Rather than trying to limit yourself to just one session or remembering what is running on which screen, you can set a name for the session by using the `-S` argument: ``` [root@rhel7dev ~]# screen -S "db upgrade" [detached from 25778.db upgrade] [root@rhel7dev ~]# screen -ls There are screens on:     25778.db upgrade    (Detached)     25706.pts-0.rhel7dev    (Detached)     25693.pts-0.rhel7dev    (Detached)     25665.pts-0.rhel7dev    (Detached) 4 Sockets in /var/run/screen/S-root. [root@rhel7dev ~]# screen -x "db upgrade" [detached from 25778.db upgrade] [root@rhel7dev ~]# ``` To exit a screen session, you can type `exit` or hit **Ctrl+A** and then **D**. Now that you know how to start, stop, and label `screen` sessions let's get a little more in-depth. To split your screen session in half vertically hit **Ctrl+A** and then the **\|** key (**Shift+Backslash**). At this point, you’ll have your screen session with the prompt on the left: [![Split screen feature of the screen command](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image3_0.png)](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image3_0.png) To switch to your screen on the right, hit **Ctrl+A** and then the **Tab** key. Your cursor is now in the right session, but there’s no prompt. To get a prompt hit **Ctrl+A** and then **C**. I can do this multiple times to get multiple vertical splits to the screen: [![Three split screens with the screen command](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image1_0.png)](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image1_0.png) You can now toggle back and forth between the two screen panes by using **Ctrl+A+Tab**. What happens when you `cat` out a file that’s larger than your console can display and so some content scrolls past? To scroll back in the buffer, hit **Ctrl+A** and then **Esc**. You’ll now be able to use the cursor keys to move around the screen and go back in the buffer. There are other options for `screen`, so to see them, hit **Ctrl**, then **A**, then the **question mark**: [![List of options for the screen command](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image2_0.png)](https://www.redhat.com/rhdc/managed-files/sysadmin/2021-02/image2_0.png) ***\[ Free online course: [Red Hat Enterprise Linux technical overview](https://www.redhat.com/en/services/training/rh024-red-hat-linux-technical-overview?intcmp=701f20000012ngPAAQ). \]*** Further reading can be found in the man page for `screen`. This article is a quick introduction to using the `screen` command so that a disconnected remote session does not end up killing a process accidentally. Another program that is similar to `screen` is `tmux` and you can read about `tmux` in [this article](https://www.redhat.com/sysadmin/tips-using-tmux).
Shard14 (laksa)
Root Hash4780968593380432814
Unparsed URLcom,redhat!www,/en/blog/tips-using-screen s443