3

What's the difference between screen -S <sessionname> and screen -t <name>? It seems that both assign a name to the newly created screen, which can be reattached using this name.

3

-t <name> sets the default title for newly created shells in your screen session. If you invoke screen -t MyShell then type Ctrl+a c Ctrl+a c Ctrl+a w, you will see them at the bottom of your terminal:

0$ MyShell  1-$ MyShell  2*$ MyShell  

You can change each title of shells by typing Ctrl+a A.

-S <sessionname> sets the name of the screen session you create. You can see existing sesions in the system with -ls, then attach one of them using that session name by -r <sessionname>. This feature is usefull especially when you have to maintain multiple screen sessions simultaneously.

$ screen -ls
There are screens on:
    23834.pts-4.myserver    (06/01/15 12:38:11) (Detached)
    23812.MySession (06/01/15 12:34:24) (Detached)
2 Sockets in /var/run/screen/S-yaegashi.

$ screen -r MySession

You can change the name of current session by typing Ctrl+a : then enter sessionname <newsessioname>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.