One possible usage for screen is to run big tasks on a remote computer
- E.g. Login via: ssh -l user -X 220.127.116.11
- start screen via: screen or you can specify a meaningful name: screen -S peterssession
- You will see a welcome message. Just hit return and you will see the konsole again.But now screen is ‘active’ and
- You can run a big task
- To create another window (e.g. for your favorite editor) just hit “CTRL a” followed by c. Try to switch between the windows with CTRL a, CTRL a
- Now you can detach from those two windows with CTRL a, CTRL d. After this it is possible to disconnect, although the remote computer will work with your big task. And you can even shutdown your local machine, if the big task does not need a x-server. The big task will run on the server in ‘background’.
- Reattach to the previously session (where we created 2 windows) with: screen -r or if the session was not detached you should use screen -x if the -r does not work.
- Now to ‘really’ logout just type ‘exit’ or press CTRL D for every windows you created. Or force screen to exit with CTRL a, CTRL \
- CTRL a, ? = prints the help
- CTRL a, c = creates a new window
- CTRL a, CTRL a = switches between the windows
- CTRL a, CTRL d = detaches from the session
- screen -r = reattaches to the first session (with possible several windows)
- CTRL a, w = list all available windows in this session or use
- CTRL a, ” = a table like list of all windows