Screen
What is Screen
screen
is a Linux program that can be used to to create several virtual terminals running different processes from a single terminal window, or in the case of the HPC, a single ssh
connection. This makes it easy to manage multiple detached, long-running jobs (e.g., rsync
commands).
Using Screen with the HPC Cluster
Why you should use it
When your wifi cuts out and jobs fail, you can reattach your jobs back to terminal through the screen program. Generally speaking, there are 4 advantages to using screen. It enables you to:
Use multiple shell windows from a single SSH session.
Keep a shell active even through network disruptions.
Disconnect and re-connect to a shell sessions from multiple locations.
Run a long running process without maintaining an active shell session.
Where to use it
Only the login nodes install the screen. i.e. only login.storrs.hpc.uconn.edu
.
How to use it
To start using screen
Simply run
screen
[jth10001@login4 ~]$ screen
Congratulations, you are now inside of a window within screen. This functions just like a normal shell except for a few special characters.
Screen Quick Reference
Basic
Description | Command |
---|---|
Start a new session with session name |
|
List running sessions / screens |
|
Attach to a running session |
|
Attach to a running session with name |
|
Detach a running session |
|
Kill a running session |
|
Accessing a screen that is already attached |
|
Escape Key
All screen commands are prefixed by an escape key, by default Ctrl-a (that's Control-a, sometimes written ^a). To send a literal Ctrl-a to the programs in screen, use Ctrl-a a. This is useful when when working with screen within screen. For example Ctrl-a a n will move screen to a new window on the screen within screen.
Getting Out
Description | Command |
---|---|
detach |
|
detach and logout (quick exit) |
|
exit screen |
|
force-exit screen |
|
Help
Description | Command |
---|---|
See help |
|
Window Management
Description | Command |
---|---|
Create new window |
|
Change to last-visited active window |
|
Change to window by number |
|
Change to window by number or name |
|
Change to next window in list |
|
Change to previous window in list |
|
See window list |
|
Show window bar |
|
Kill current window |
|
Kill all windows |
|
Rename current window |
|
Split screen
Description | Command |
---|---|
Split display horizontally |
|
Split display vertically |
|
Jump to next display region |
|
Remove current region |
|
Remove all regions but the current one |
|
Misc
Description | Command |
---|---|
Redraw window |
|
Enter copy mode |
|
Paste |
|
Monitor window for activity |
|
Monitor window for silence |
|
Enter digraph (for producing non-ASCII characters) |
|
Lock (password protect) display |
|
Enter screen command |
|
Enable logging in the screen session |
|
Scrolling
Description | Command |
---|---|
Enter scrolling mode |
|
Scroll Up |
|
Scroll Down |
|
Exit scrolling mode |
|
More Information
For more help visit GNU screen website. screen has functionality beyond just resuming and detaching from sessions.