Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have about 15 instances of screen running on my linux server. They are each running processes I need to monitor. I had to close terminal (hence the reason I launched screen).

Is there a way to reopen all 15 instances of Screen in different tabs without having to open a new tab, login to the server, print all the available screens to resume, and then type in the id for each screen session?

share|improve this question
What terminal are you using? Gnome Terminal, KDE, other? – cjm Jul 12 '11 at 9:19
ANSWER (@cjm): I'm using terminal on mac osx. – T. Brian Jones Jul 12 '11 at 9:21
up vote 0 down vote accepted

This python script just did the job for me. I made three screen sessions and this fires up three xterms with the sessions reattached in each. It's a bit ugly but it works.

#! /usr/bin/env python                                                                                                                         

import os

if __name__ == '__main__':

    tempfile = '//tmp//screenList'

    # capture allthescreenIds                                                                                                                
    os.system('screen -ls | grep Det | cut -d . -f 1 > ' + tempfile)

    f = open(tempfile, 'r')
    screenIds = f.readlines()

    screenIds = [x.lstrip() for x in screenIds]

    for eachId in screenIds:
        cmdLine = 'xterm -e screen -r ' + eachId.strip() + ' &'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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