I learned to use gnu-screen and have been using it for the past several weeks. I got a grip of the basics now, and would be very helpful if I get these queries clarified:

  1. How do I rename / reorder / move windows in Linux screen utility?

    For eg., after a few days of use, I come to a state where the window-numbers are 2, 3, 6, 8. Now I want a new-window to be created at #9, or #7. Is this possible? If yes, how?

    Also, is it possible to 'move' the window #6 to #4 or #7? If yes, how?

  2. Scrolling shortcut: Scroll takes Ctrl-A + Esc, and then Ctrl-u / Ctrl-d. Is there a way to map PgUp / PgDn to do these directly? Or, is there a way to map some key (like F5) to take me to copy mode, and then PgUp / PgDn for scrolling?

  3. I have enabled "caption always", so the current window title is displayed always at the bottom. Is there a way to display the current window's log-file-name and logging status (on/off) in the same caption bar?

  • 37
    :number X moves window to specific position – Ency Mar 7 '11 at 18:08
  • Check this out hardstatus string "%{.kG}%-Lw%{.KW}%n%f %t%{-}%+Lw %=%{..G} %H %{..W} %d/%m %C%a " it provides a lot of information (Z$L..) for all windows at time – Ency Mar 7 '11 at 20:52
  • Ency : thanks for the hardstatus string tip. It shows lot of details, but not the logfile name and status info. Any idea on this ? – Rangzy Mar 8 '11 at 8:50
  • 1
    That's not true, in screen do ctrl+A ctrl+| for a vertical split – Nick Garvey Aug 14 '12 at 0:51
  • 1
    @NickGarvey the vertical split patch for screen is not in GNU Screen. It is a patch that is applied by some distros. – Jason Axelson Aug 14 '12 at 1:18

You can renumber the current window with ctrl+a :number x where x is a numeric argument.

You can rename the current window with ctrl+a A

  • 14
    Renumbering even works if the new number is already in use. In this case the windows exchange their numbers. Nice. – Uwe Geuder Dec 17 '12 at 14:16
  • 3
    I was a little confused at first. You have to type the literal string "number" and x is the kind of parameter to the number renaming function. – rrenaud Sep 6 '14 at 21:10
  • 2
    More symetrically and easier to remember you can do: ctrl+a :title new window title – Wadih M. Feb 14 '16 at 1:27
  • @WadihM. just so long as there's no spaces in the new_window_title – 22degrees Mar 31 '16 at 21:08

You can move windows up and down with this:

ctrl+a :windowlist then . (dot)-down and , (comma)-up


ctrl+a " then . (dot)-down and , (comma)-up

(From here.)

  • 12
    Adding to weinerk's answer, you can show list of windows by ctrl+a " – Stan Brajewski Jan 4 '17 at 8:37
  • 4
    :windowlist is way more useful than :number when doing a big cleanup / reorganisation. – Jamie McNaught Jun 27 '17 at 10:39
  • Another somewhat relevant feature for ease of navigation - you can name/rename each window: ctrl+a A or ctrl+a :title – weinerk Apr 5 '20 at 14:35

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.