- Once the screen utility has created a new window, all the keystrokes go to the task running in that window, except Control-A (Ctrl-A), which marks the start of a screen command.
- Creating screen windows: To create a new screen, run the command screen from your shell. You will see a welcome message with information about the screen. Press Space or Return to return to the shell prompt. To create a new virtual terminal, press Ctrl + A and then C (these are case-sensitive) or type screen again.
- Viewing a list of open windows: While running the screen, pressing Ctrl+A followed by a quote (") will list your terminal sessions.
- Switching between windows: The keystrokes Ctrl + A and Ctrl + N display the next window and Ctrl + A and Ctrl + P the previous window.
- Attaching to and detaching screens: The screen command supports saving and loading screen sessions, called detaching and attaching in screen terminology. To detach from the current screen session, press Ctrl + A and Ctrl + D. To attach to an existing screen when starting the screen, use:
screen -r -d
- This tells the screen to attach the last screen session. If you have more than one detached session, the screen will output a list; then use:
screen -r -d PID
Here, PID is the PID of the screen session you want to attach.