screen detach from session code example
Example 1: create a screen command
screen -S screen_name
Example 2: screen reattach to session
> Starting Named Session
$ screen -S session_name
> Find the session ID list
$ screen -ls
> Restore screen or connect to existing session
$ screen -r session_nameORsession_ID
> I'm in a screen session? Which one?
> I am in screen
$ echo $STY
29624.pts-1.iain-10-04
$
> I am not in screen
$ echo $STY
$