Friday, October 13, 2006

The amazing screen utility

How many times did you start something in an SSH session and then really needed to leave, and wanted to attach to it from somewhere else.
The answer has been around in shell for years. Once I got used to it, I can never live without screen.
Read the man page .. but in short, screen lets you create sessions and then detach from them and reattach from somewhere else.

To create a screen session run:
screen
or, you can also : screen -dR (which tries to reattach to an existing session or run a new one).

To detach type : ctrl-A d

To reattach type : screen -r (potentiallty add the session id if there are more than one)

To see a list of sessions : screen -ls
you can specify a specific terminal if there are a few when reattaching.

fun fun fun !

No comments: