Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to change the name of a GNU screen session? Say I called started it with "screen -S foo" and I want to rename it to bar.

share|improve this question
Duplicate of stackoverflow.com/questions/3202111/… –  l0b0 Aug 9 '12 at 8:00
@l0b0 That's about naming. This is about renaming. –  marcog Aug 9 '12 at 18:06

3 Answers 3

up vote 113 down vote accepted


C-a :sessionname mySessionName


This is,

0) Attach to the session in question.

1) Ctrl + a

2) Type ":sessionname mySessionName" - yes, the first colon is needed there, no extra spaces.

3) Type Enter.


$ screen -S foo
[detached from 8890.foo]
$ screen -ls
There is a screen on:
    8890.foo    (22/12/11 18:39:22) (Detached)
1 Socket in /var/run/screen/S-user.

$ screen -r

( "C-a :sessionname bars" here )

[detached from 8890.bars]
$ screen -ls
There is a screen on:
    8890.bars   (22/12/11 18:39:21) (Detached)
1 Socket in /var/run/screen/S-user.


Renaming without attaching

Screen's -X switch lets you rename a session without attaching it.

$ screen -X sessionname foobars
$ screen -ls
There is a screen on:
    8890.foobars    (22/12/11 18:39:22) (Detached)
1 Socket in /var/run/screen/S-user.

share|improve this answer

If there are several sessions, use:

screen -S 8890.foo -X sessionname bar
share|improve this answer
This is a better answer than the one above because it deals with the general case of multiple sessions –  doon May 21 '13 at 17:21
This is the best answer –  Coc Dec 3 '13 at 10:18

The easiest way is to rename it straight from inside the session.

If you have several sessions running, then:

  1. Switch to the one you want to rename -- Ctrl-a + Shift"
  2. Highlight the session you want rename, and press Enter.
  3. Press Ctrl-a + A (it's an uppercase a, i.e. Shift+a), type the new name, and press Enter.
share|improve this answer
I think the question was about renaming the session, but this answer renames windows. –  Dan Gravell Sep 9 '14 at 9:48

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.