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.

  1. Create a screen session
    1. Enter screen -S session_name


Image

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.


  1. Save the screen session by detaching
    1. Press Crtl+A followed by D. You will receive a confirmation message stating you’ve detached from the screen session.

Image

  1. Reattach to a screen session
    1. Enter screen -ls to display all screen sessions you’ve created.

Image

    1. Enter screen -r session_id to reattach to a screen session.

Image

Image

  1. Kill a screen session
    1. 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.

Image

Image