To solve issues with broken pipes etc when connecting to remote boxes. Very useful, especially when installing things or running long commands.
GNU Screen allows you to have a ‘screen session’ on the remote box that you can run multiple commands in, via multiple ‘screen windows’. This will simply detach if your parent SSH connection dies, keeping all the subprocesses running within it alive and well.
- Start a screen session (on your remote host):
- Detach from your screen session: CTRL-A, d
- Re-attach to your screen session after logging back in again:
$ screen -d -r
- Open another screen ‘window’: CTRL-A, c
- Cycle through you open screen windows: CTRL-A, space