UsingScreen
Screen is a utility program that allows for easy management of multiple terminals. It allows you to manage multiple terminal sessions from within one terminal session. You can switch between terminals using a the CTRL keys and can run different (interactive) programs in each session. You can even detach the session from the current terminal, close the terminal, and the reconnect to the running session from another terminal. For example, if you connect to the cluster with ssh, you can spawn multiple terminal connections using "screen". You can then disconnect the spawned sessions from the current ssh connection. Then when you next reconnect to the cluster (ie ssh), you can reconnect to the spawned sessions and resume your work. This is very similar to how we use VNC but does not require a graphical connection.
For a detailed discussion of "screen" see:
Basic commands to get started:
- To create a session called "mySessionName"
bash$ screen -xR mySessionName
- To detach the current session
bash$ CTRL-a d
- To reattach to an existing session (same as creating a session)
bash$ screen -xR mySessionName
- If a session is attached elsewhere and you want to force it to detach from the other terminal and attach to your existing terminal
bash$ screen -d -r mySessionName
- 'screen -d' will give a list of detached screen. You can then use 'screen -xR {session number}' to attach to one of the screens in the list.