How to use the screen command
The screen command allows you to use multiple shell sessions within one ssh session. This process can be accomplished by attaching, detaching, and reattaching from shell sessions.
Follow the steps below to use the screen command on the Grid.
- Create a screen session
- Enter screen -S session_name
- Enter screen -S session_name
b. Start an interactive job. See https://tech.wayne.edu/kb/high-performance-computing/hpc-tutorials/500259 for instructions on how to start an interactive job.
Note: Your interactive job will end based on the specified walltime even when you detach from the screen session.
- Save the screen session by detaching
- Press Crtl+A followed by D. You will receive a confirmation message stating youâve detached from the screen session.
- Reattach to a screen session
- Enter screen -ls to display all screen sessions youâve created.
- Enter screen -r session_id to reattach to a screen session.
- Kill a screen session
- Reattach to the screen session as shown in step 3 then enter exit. You will receive a confirmation message stating the screen has been terminated and when you enter screen -ls the screen session will no longer be listed.
- Reattach to the screen session as shown in step 3 then enter exit. You will receive a confirmation message stating the screen has been terminated and when you enter screen -ls the screen session will no longer be listed.