Naming screen sessions. (tummy.com, ltd. Journal Entry)
tummy.com: we do linux

Sunday January 17, at 13:56
Subject: Naming screen sessions.
Keywords: Linux, Screen
Posted by: Sean Reifschneider

On some systems I have long-running screen sessions, like on one system where I run folding under it, and I've also started running the zfs-fuse daemon under screen. The normal naming causes me to end up with a bunch of screens that I have to hunt through to find the one I want:

guin:~$ screen -x
You may wish for a screen, what do you want?
        13658.pts-13.guin       (Detached)
        13639.pts-13.guin       (Detached)
        13678.pts-13.guin       (Attached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
zsh: exit 1     screen -x
guin:~$ 

I started hunting for a way to get some more information about what was on each screen, and found the "-S [sessionname]" option. Just what I need:

root@stow:~# screen -x
There are several suitable screens on:
        20873.pts-4.stow        (Detached)
        20303.zfs       (Detached)
        20224.folding   (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
root@stow:~# 

So now I can see which one s the one I started for just whatever (the "pts" one), and I can resume screen sessions with "screen -x folding" or "screen -x pts" to get to the generic one.
(Post Reply)

Comment
Nate Thompson
Subject: Its the simple things...
Nice! Its funny how its the simple things that get overlooked sometimes...I too would look at my mess of screen sessions thinking there had to be a better way, but in all those times looking through the manpage looking options to do various things, I always overlooked that....