4

is there a way to open/attach to all detached screen sessions on linux in one command/script? typically I have the following flow to open a session:

#see all screen sessions
screen -rD 
#attach to one screen session
screen -rD screen_name
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user121196
  • 30,032
  • 57
  • 148
  • 198
  • explain what you are trying to achieve. You can't open more than one session because you operate on only one terminal and for more sessions you need more terminals. Now there could be a way to union all sessions, but I don't know how. – akostadinov Apr 13 '13 at 05:45
  • @akostadinov: I usually have aroun 6 screen sessions and I would have to type in 7 commands to check on all of them, one for listing the session names, 6 for attaching to them in 6 new terminals. is there a way to simplify this? – user121196 Apr 14 '13 at 03:32

1 Answers1

2

It would be easier to have only one screen session with many terminals within. You create a new terminal with Ctrl+a+c, then you switch through them with Ctrl+a+<space> or <backspace> or a number. I don't think there is an easier way if you do that manually. If you spawn sessions with a script, you may try using -X to make screen open a new window in an existing session and execute commands in there. Perhaps this answer is close to what you would need. You will need to make sure you name your screen session in a way, you can reference it later unambiguously.

Community
  • 1
  • 1
akostadinov
  • 17,364
  • 6
  • 77
  • 85