If you\u2019ve ever had to restart a time-consuming process because your SSH session was disconnected, you might be very happy to learn about an interesting tool that you can use to avoid this problem\u00a0\u2013 the screen tool.\nScreen, which is a terminal multiplexor, allows you to run many terminal sessions within a single ssh session, detaching from them and reattaching them as needed. The process for doing this is surprising simple and involves only a handful of commands.\n\nTo start a screen session, you simply type screen within your ssh session. You then start your long-running process, type Ctrl+A Ctrl+D to detach from the session and screen -r to reattach when the time is right.\nIf you\u2019re going to run more than one screen session, a better option is to give each session a meaningful name that will help you remember what task is being handled in it. Using this approach, you would name each session when you start it by using a command like this:\n$ screen -S slow-build\nOnce you have multiple sessions running, reattaching to one then requires that you pick it from the list. In the commands below, we list the currently running sessions before reattaching one of them. Notice that initially both sessions are marked as being detached.\n$ screen -ls\nThere are screens on:\n 6617.check-backups (09\/26\/2019 04:35:30 PM) (Detached)\n 1946.slow-build (09\/26\/2019 02:51:50 PM) (Detached)\n2 Sockets in \/run\/screen\/S-shs\n\nReattaching to the session then requires that you supply the assigned name. For example:\n$ screen -r slow-build\nThe process you left running should have continued processing while it was detached and you were doing some other work. If you ask about your screen sessions while using one of them, you should see that the session you\u2019re currently reattached to is once again \u201cattached.\u201d\n$ screen -ls\nThere are screens on:\n 6617.check-backups (09\/26\/2019 04:35:30 PM) (Attached)\n 1946.slow-build (09\/26\/2019 02:51:50 PM) (Detached)\n2 Sockets in \/run\/screen\/S-shs.\n\nYou can ask what version of screen you\u2019re running with the -version option.\n$ screen -version\nScreen version 4.06.02 (GNU) 23-Oct-17\n\n\n\n \n\n\nInstalling screen\nIf \u201cwhich screen\u201d doesn\u2019t provide information on screen, it probably isn't installed on your system.\n$ which screen\n\/usr\/bin\/screen\n\nIf you need to install it, one of the following commands is probably right for your system:\nsudo apt install screen\nsudo yum install screen\n\nThe screen tool comes in handy whenever you need to run time-consuming processes that could be interrupted if your SSH session for any reason disconnects. And, as you've just seen, it\u2019s very easy to use and manage.\nHere's a recap of the commands used above:\nscreen -S \tstart a session\nCtrl+A Ctrl+D\t\t\t\tdetach from a session\nscreen -ls\t\t\t\tlist sessions\nscreen -r \t reattach a session\n\nWhile there is more to know about screen, including additional ways that you can maneuver between screen sessions, this should get you started using this handy tool.