linux screen

Linux Screen Tutorial and How To

Has this happened to you?

You are logged into your remote server via SSH and happily plucking along at your keyboard and then it happens. Suddenly, the characters stop moving and then you get the dreaded “Connection Closed” message. You have just lost your session. You were halfway through some task and now you have to start over. Ugh.

You can prevent this by learning how to use Linux screen.

In fact, you can learn the basics in just 2 minutes.

The Linux screen tool can not only save you from disconnection disasters, but it also can increase your productivity by using multiple windows within one SSH session. I use this tool all of the time as part of our server management services.

2 Minute Intro

(Sorry for the font size, will record this again soon.)

Linux Screen How-To

Linux Screen for Session Management!

linux screen tutoral

Linux Screen showing the GNU page for Linux Screen Itself

Linux Screen Can Save you from that Lost Connection

What is Screen for Linux?

As the man page states, “Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).” This can be a life saver when working on your dedicated server. Linux screen has a several great features for helping you administer your server more productively and safely. I am going to discuss the three features (multiple windows, logging, sessions) that I use the most. Once you mastered screen, you may want to check out our 12 Point Server Maintenance Checklist and put your new found skills to use.

Installing Screen on Linux

Chances are that you already have screen on your system. On most Red Hat distributions you can find Linux screen  in /usr/bin/screen. To see if screen is in your path, you can use the which command:

[admin@ensim admin]$ which screen

If you do not have screen, then you can install it easily from an RPM or the package file for your system. On Cobalt Raq servers, you can safely use the RedHat RPMS appropriate for your system.
Screen RPMs: rpmfind
Screen Web site: GNU Screen

As you probably already have screen or can use an RPM, I am not going to cover the building of screen from source. Lets get on to how to use screen.

Using Linux Screen

Screen is started from the command line just like any other command:

[admin@gigan admin]$ screen

You may or may not get a text message about screen. If you do not, then you probably think nothing has happened, but it has. You are now inside of a window within screen. This functions just like a normal shell except for a few special characters. Screen uses the command “Ctrl-A” as a signal to send commands to screen instead of the shell. To get help, just use “Ctrl-A” then “?”. You should now have the screen help page.

Screen key bindings, page 1 of 2.

 Screen key bindings, page 1 of 4.

Command key:  ^A   Literal ^A:  a

break      ^B b          only       Q
clear      C             other      ^A
colon      :             pow_break  B
copy       ^[ [          pow_detach D
detach     ^D d          prev       ^P p ^?
digraph    ^V            readbuf    <
displays   *             redisplay  ^L l
fit        F             removebuf  =
flow       ^F f          reset      Z
focus      ^I            screen     ^C c
hardcopy   h             select     '
help       ?             silence    _

Key bindings are the commands the screen accepts after you hit “Ctrl-A”. You can reconfigure these keys to your liking using a .screenrc file, but I just use the defaults. The power of screen will become obvious, especially if you need to bounce around to different file system locations and leave processes running. For example, when I go in to clean out wasted disk space, I can remove files in one screen while hunting for other files in another.

Multiple Windows

Linux screen, like many windows managers, can support multiple windows. This is very useful for doing many tasks at the same time without opening new sessions. As a systems manager, I often have four or five SSH sessions going at the same time. In each of the shell, I may be running two or three tasks. Without screen, that would require 15 SSH sessions, logins, windows, etc. With screen, each system gets its own single session and I use screen to manage different tasks on that system.

Another trick I use is when I am editing configuration files. For example, if I want to harden SSH, I can cat out the configuration file in one window and then edit it in another.

To open a new window, you just use “Ctrl-A” “c”. This will create a new window for you with your default prompt. For example, I can be running top and then open a new window to do other things. Top stays running! It is still there. To try this for yourself, start up screen and then run top. (Note: I have truncated some screens to save space.)

Start top

top - 09:10:33 up 35 days, 17:26,  1 user,  load averag
Tasks: 131 total,   1 running, 130 sleeping,   0 stoppe
Cpu(s):  0.4%us,  0.2%sy,  0.0%ni, 99.4%id,  0.0%wa,  0
Mem:  12302040k total,  6363652k used,  5938388k free, 
Swap:  1052248k total,       12k used,  1052236k free, 

Now open a new window with: "Ctrl-A” “c”

To get back to top, use “Ctrl-A “n”


top - 09:06:14 up 35 days, 17:22,  1 user,  load averag
Tasks: 131 total,   1 running, 130 sleeping,   0 stoppe
Cpu(s):  3.1%us,  0.3%sy,  0.0%ni, 96.5%id,  0.0%wa,  0
Mem:  12302040k total,  6342984k used,  5959056k free,
Swap:  1052248k total,       12k used,  1052236k free,

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM
1 root      15   0 10372  712  596 S  0.0  0.0
2 root      RT  -5     0    0    0 S  0.0  0.0
3 root      34  19     0    0    0 S  0.0  0.0

You can create several windows and toggle through them with “Ctrl-A” “n” for the next window or “Ctrl-A” “p” for the previous window. Each process will keep running while your work elsewhere.

Leaving Linux Screen

There are two ways to get out of screen. The first is just like logging out of a shell. You kill the window with “Ctrl-A” “K” or “exit” will work on some systems. This will kill the current windows. If you have other windows, you will drop into one of those. If this is the last window, then you will exit screen.

The second way to leave screen is to detach from a windows. This method leaves the process running and simple closes the window. If you have really long processes, you need to close your SSH program, you can detach from the window using “Ctrl-A” “d”. This will drop you into your shell. All screen windows are still there and you can re-attach to them later. This is great when you are using rsync for server migration.

Attaching to Sessions

So you are using screen now and compiling that program. It is taking forever and suddenly your connection drops. Don’t worry screen will keep the compilation going. Login to your system and use the screen listing tool to see what sessions are running:

[root@gigan root]# screen -ls
There are screens on:
        31619.ttyp2.gigan       (Detached)
        4731.ttyp2.gigan        (Detached)
2 Sockets in /tmp/screens/S-root.

Here you see I have two different screen sessions. To re-attach to a session, use the re-attach command:

[root@gigan root]#screen -r 31619.ttyp2.gigan

Just use screen with the -r flag and the session name. You are now re-attached to the screen. A nice thing about this, is you can re-attach from anywhere. If you are at work or a clients office, you can use Linux screen to start a job and then logout. When you get back to your office or home, you can login and get back to work.

Screen Logging

As a consultant, I find it important to keep track of what I do to someone’s server. Fortunately, screen makes this easy. Using “Ctrl-A” “H”, creates a running log of the session. Screen will keep appending data to the file through multiple sessions. Using the log function is very useful for capturing what you have done, especially if you are making a lot of changes. If something goes awry, you can look back through your logs.

Linux Screen Tips

Just wanted to mention to other cool tricks you can do with Linux screen. Screen can monitor a window for activity or lack thereof. This is great if you are downloading large files, compiling, or watching for output. If you are downloading something or compiling, you can watch for silence. To start the monitor, go to the screen you want to monitor and use “Ctrl-A” “M” to look for activity or “Ctrl-A” “_” to monitor for silence. Then open or switch to a new window. When the monitor detects activity or silence, you will get an alert at the bottom with the window number. To quickly go to that window, use “Ctrl-A” “ (thats a quote mark, ctrl-a then a “). After you do this, just type in the number of the window and enter. To stop monitoring, go to that window and undo the monitor with the same command. For example, to stop monitoring for activity you would use “Ctrl-A” “M” again.

Screen is a great tool and I use it daily for tasking ranging from hardening ssh against brute force attacks to deploying Nginx web server for a client.

Reference

Linux screen was covered recently in Linux Magazine by Adam Lazur (Jan 2003, Issue 105). Much of his information was adapted for this rackTIP. Other information was collected from the man pages.

The following two tabs change content below.
Jeff is the CEO and founder of rackAID. He has been working in hosting industry since the days of Rackshack's famed customer appreciation parties back in the early 2000's. Jeff is an avid cyclist, wine enthusiast, and admitted Kraftwerk listener (please don't hold that against him). You may spot him at any number of hosting, startup and small business conferences

98 Comments

  • maks November 19, 2009 at 5:10 am

    Fyi, you can attach with just the pid i.e. “screen -r 12345”

    Great tut!

  • How 2 dev November 24, 2009 at 10:49 am

    I used to work with nohup until some problems with it made me use screen which is far better from nohup.By the way nice post especially for newbies.

  • Julian December 7, 2009 at 6:32 am

    Thanks for tutorial! Close (x) will close screen on not ?

  • rackAID December 8, 2009 at 9:51 am

    I typically just exit from the screen by typing “exit”.

  • lockedout December 22, 2009 at 11:27 am

    Installed screen on an ubuntu server and couldn’t log back in.

    Guessing it messed up some pam config.

    Searching for anything with “screen” in it is an exercise in aggravation.

  • chusty January 24, 2010 at 7:24 am

    I have screen installed on 3 or 4 dedicated servers … it’s silly but on one of them I have a bar in the bottom of it – which is very handy… and don’t know how to turn it on on the rest of my servers :)

  • coskan February 8, 2010 at 6:51 am

    extremely helpful and definitive. thank you for sharing

  • Laetitia February 18, 2010 at 4:27 am

    I am using ssh and screen to work remotely on a linux server with my macbook. It works quite well to some extend. The only problem I have is that there is nothing like “Ctr-A” on a mac keyboard. So I cannot use “K”, “p” and “n” directly. Does anybody know what shortcut I need?
    Thanks.

  • Johan March 9, 2010 at 9:55 am

    @Laetitia – I use a macbook (intel osx 10.4) and have no trouble… im pretty sure you will find a “Ctrl” key on your mac keyboard, somewhere to the left of space bar and below your shift key.
    http://images.apple.com/keyboard/images/gallery/wired_1_20070813.jpg

  • garvald March 9, 2010 at 6:46 am

    laetitia – mac keyboards have a “ctrl” key and of course the “a”  key – surely you dont mean that?

  • Juli Zurovec March 15, 2010 at 10:20 am

    We just got our first Mac in our office last week.  Will have to ask our new staff member how to do it.

  • Radu D March 18, 2010 at 6:52 am

    There is any way to run this tool on a linksys router wrt54GL with dd-wrt firmware on it?

  • Richard March 19, 2010 at 9:49 am

    Instead of using Ctl-A for commands, I use the backtick key (key to the left of the ‘1’ key).
    To do this I entered the following commands into my .screenrc file:
    defescape “
    escape     “
    (those are 2 backticks for each entry)
    Now to create a new screen window, all I have to enter is `c.
    Great write-up.  Just enough for me to go and find additional information & uses for the screen command.

  • John Doyle April 1, 2010 at 12:10 pm

    Nice I used this to run fsck and remote back in later on from home as it requires user input and you cannot use nohup with fsck easily if you want user input to fix errors etc.
    Thanks

  • supi007 April 9, 2010 at 4:05 am

    This is a good tutorial. Thx.

  • jacco April 15, 2010 at 4:54 am

    chusty: Add “hardstatus alwayslastline” to your .screenrc

  • dsb45 May 1, 2010 at 5:32 am

    Hi,
    What about env variables with screen command ?  Do you export all you need in new window, or what procedure should one follow ?
    Thanks !

  • quenenni May 3, 2010 at 2:22 am

    Thanks for your article. I discovered control keys I didn’t know. The logging thing sounds great.

    2 points I wanted to add:
    Another nice thing with screen is that several access can be done at the same time.
    That means several people can connect to the same screen and see live what others are doing.
    Great stuff when ie you want to explain how something is working.. a bit like a live tuto.

    And you can also use the .screenrc file to change the way it shows the sessions. Ie, all the active sessions are shown at the bottom and colored, you can give them a name, you can choose the number of sessions to launch when starting screen and execute a command in these sessions, like a ssh tunnel or a monitoring software.
    you can greatly improve the layout of screen by changing them.

    As it was someone who gave me that config file, I don’t know what options exactly do these tricks.
    If you are interested to have mine to analyse the options, contact me.

  • Alex May 21, 2010 at 8:15 am

    Thank you, a great article, very helpful!

  • Matthew Kress May 21, 2010 at 6:43 am

    quenenni, I would love to see you config file.  Could you please post it?

  • mehrdad May 24, 2010 at 4:50 am

    Thanks, It was very helpful.

  • Mech June 7, 2010 at 1:09 am

    Thanks, extremely well writen

  • dsb45 June 7, 2010 at 7:17 am

    quenenni,
    I would also be interested in seeing
    your config file.  As Matthew requested, can you post it, or a url to where we can view it ?  Thanks for your input.

  • quenenni June 9, 2010 at 6:59 am

    Yop yop..

    I sent the file to the website owner already few weeks ago, but it seems something went wrong.

    Anyway, here it is:
    http://quenenni.domainepublic.net/screenrc.txt
    Put it in the home directory under the name ‘.screenrc’ .

  • Jeff H. June 10, 2010 at 10:34 am

    I know you submitted a ticket in our sales area but I never saw the other email with the screen file. I wonder if the security system flagged it or someone else here deleted by mistake. Thanks for posting it again.

  • steevo June 18, 2010 at 5:13 am

    Thanks a lot, a friend showed me once how to use screen, and this is a great refresher/reference. It should be installed as default when you apt-get ssh-server

  • Matthew Wilcoxson June 29, 2010 at 11:20 am

    Yep, screen is a really useful tool.

    At the moment I use the enhanced version called “byobu”, which adds a cool bar at the bottom of the window with useful information. (That’s probably what @chusty has found)

  • Jeff H July 7, 2010 at 9:28 am

    Glad you liked our tutorial.  I think there are some newer tools out there, but I always fall back on screen for its simplicity and easy of use.

  • Aaron July 7, 2010 at 4:47 am

    This tutorial is very clear and really helpful.  Sometimes there are just a few small things that you need to get over a learning curve and this did it for me.
    I am using screen on my Dreamhost hosted site to run Nodejs to experiment.  I can log out of my ssh session and node is still chugging along.  Thank you!

  • gkokmdam August 12, 2010 at 2:49 am

    Just great! Specially thanks to @quenenni for your .screenrc !

  • Lakshmi Naarayanan August 30, 2010 at 10:02 am

    Hi Jeff,

    Useful tutorial – I’ve had the screen die on my occasionally (once in 2-3 months or so) – I am left helpless when it dies, basically all record of which machines I logged into etc are lost. Is there any way to resurrect a dead screen? Or port an existing screen to a different machine? I am looking for some way to recover a session either from its dead state or from another machine with a history file or something like that..

  • Jeff H August 30, 2010 at 10:44 am

    What is being shown with screen—list?
    If it is listed as attached, you can use:

    screen -x -R

    and it will force detach the screen.  If it is listed as dead, the socket is no longer active and it cannot be recovered.

  • Adam Kleiner September 12, 2010 at 2:01 am

    Cool. Will have to try it out!

  • Gambakoker September 16, 2010 at 9:49 am

    Fantastic tutorial / HowTo! Clear and simple. I searched a while for a good one like yours. Thank you very much.

  • Chepech September 28, 2010 at 4:44 am

    The Num Pad on my keyboard doesnt work with screen, also my keyboard layout is lost, but as soon as I close it, it gets back to normal, any ideas?

  • Gaurav October 28, 2010 at 4:43 am

    Thanks for writing this up! It was very helpful.

  • Lorraine November 30, 2010 at 10:34 am

    Haha, your intro paragraph summed up exactly how I used to feel before I discovered screen.

  • TuffRank December 4, 2010 at 7:33 am

    Kool info, very useful indeed….

  • Jeff H December 6, 2010 at 10:45 am

    Thanks for the feedback. I should probably do a screen tutorial part 2.  I never imagined when I first wrote this years ago it would be so popular.

  • ye December 17, 2010 at 4:19 am

    great tutorial

  • Fort Collins December 19, 2010 at 3:50 am

    Perfect. Most screen tuts didn’t point out that you need to press CTRL+A THEEEN another key.. Thanks for the post.

  • sam January 12, 2011 at 6:42 am

    Excellent article.
    I heard screen from watching support work remotely.  They actually maximized my putty and had 3 prompts going at the same time.  one was counting and the other two were tail -f of different logs.  I have been trying to recreate that using CTRL+A f   this splits the screen but does not give me another prompt.  Any thoughts on what I am doing wrong?
    thanks for the excellent article!

  • Jeff H. January 19, 2011 at 10:42 am

    To join a screen that is already attached, use:
    screen -x screenid
    You can get the screen ID number using list:
    [root@gigan ~]# screen -list
    There is a screen on:
          29878.pts-6.gigan     (Attached)

    screen -x 29878.pts-6.gigan
    Will attach you to that screen. Both users have control so be careful.

    I use this when training or reviewing staff.

  • dhina January 19, 2011 at 4:21 am

    Thanks for the nice article.

    @quenenni you mentioned “That means several people can connect to the same screen and see live what others are doing.”

    can you tell how to do this

  • Sparx March 13, 2011 at 2:10 am

    Thanks for this tutorial! It helped me so much, this is EXACTLY what I needed :)

  • JesseTaylor March 13, 2011 at 3:23 am

    Great intro. I was just starting to play around with screen, and yours was the first tutorial that came up on Google (I see why!). Thanks for putting this together.

  • Cezar March 12, 2011 at 7:51 am

    Best screen tutorial on the net!

  • Chantu April 4, 2011 at 4:15 am

    Dear Jeff

    Awesome tutorial. I have been using Screens for last 6+ years and it works great. I leave all my windows as it is and next day i get my work as it is. Saves me lot of times.

    Recently i was stuck on screen as it went in silent monitoring mode and i was not aware of it. I came here and learned about how to use silent monitoring.

    Thanks a lot for this.
    Regards
    Chantu

  • Cubicle Generation April 7, 2011 at 12:49 pm

    Hands down the best intro to screen tutorial I’ve seen :bowdown: I wish I had this as a primer when I was trying to figure screen out.

  • Mike April 24, 2011 at 2:34 am

    The Linux command to obtain help screen for the rm command is

  • mimi June 3, 2011 at 6:09 am

    hello,
    could you please tell me how can i run a matlab code in screen?

  • jaime July 5, 2011 at 4:05 am

    Thank you it was great

  • SaschaK July 23, 2011 at 4:06 am

    Great Tutorial, great tool! This will help me monitoring/maintaining root servers. Thanks for sharing!

  • Purab August 9, 2011 at 1:25 am

    That was fast and useful ! No unrequired detail.

  • Nick Yeoman August 27, 2011 at 4:16 am

    I knew what screen was and what it did, but until this article I wasn’t proficient in using it.  Thanks so much!

  • FZambia September 8, 2011 at 2:02 am

    Thank you so much, your tutorial is great!

  • Arvent September 11, 2011 at 9:01 am

    Thank you very much. It’s surely enlightening.

  • Jeffrey Huckaby September 23, 2011 at 9:09 am

    Thanks for the feedback.  Fortunately, screen does not change much and I still use it almost daily.

  • Digit September 23, 2011 at 1:25 am

    Don’t mean to necro an old post, but thought it was worth noting you are still getting hits on this great how to.
    Excellent work!

  • Sharad September 26, 2011 at 5:31 am

    Thanks for info, it was helpful

  • Thomas Ding September 29, 2011 at 9:30 am

    Dear Jeff.,

    Awesome tutorial. I had learn much from this article.

    I have a idea about the activity monitor. Since screen can monitor the activity or silent in a windows, is it possible to invoke a user specified script or command when the silent was detected?

    If it is possible, we can get the information as soon as possible.

    Thank you very much.

  • minesh October 1, 2011 at 4:45 am

    Nice Article to get started with screen.
    I love it.

    Thanks

  • Ian October 5, 2011 at 1:23 am

    good post.. let me get into screen in 10mins. :)

  • Eduardo October 7, 2011 at 3:40 am

    Hello and thanks for the article. I use linux screen at work, but not long ago I moved to the Mac. The big problem is that it is not possible to use the mac keyboard to do simple Screen command (like ctrl+right arrow) for moving to the next screen or work with different tabs. Does anybody knows a way/tutorial/application to use linux screen command as in linux or Windows through Putty? Thanks in advance.

  • jeff October 17, 2011 at 3:37 am

    Great tutorial on screen – we’re just about to post a shorter tutorial on screen on our blog. (and no worries – we didn’t lift any ideas) …check out our open source blog @ http://www.digitalboundary.net/wp

    Thanks!
    JG

  • Event Horizon October 25, 2011 at 7:09 am

    Highly recommended – a very clear and concise tutorial.

  • E. November 2, 2011 at 7:47 am

    Wow, I never used screen before but I wonder how I did it. Found this by google, managed to find the essentials in a couple mins, great one, thanks!!!

  • Miki December 23, 2011 at 3:11 am

    We run several screen instances from one box, eg. :
    27185.pts-53.CentOS-57-64-minimal     (Detached)
    27209.pts-53.CentOS-57-64-minimal     (Detached)
    27281.pts-53.CentOS-57-64-minimal     (Detached)

    Is there a way to ‘name’ a screen id, so instead of having to remember
    the exact PID, i use screen -x 1 for pid 27185, screen -x 2 for pid 27209 and screen -x 3 for pid 27281 ??

  • chip January 6, 2012 at 12:09 pm

    say that I have 8 screen sessions running, I attach to one of them using screen -r <pid>, how do a ‘gather’ the other 7 sessions so that I can use the full functionality of stacking the screens?

  • sanjayts January 8, 2012 at 10:35 am

    @chip: Assuming you want named sessions for clarity, you can name a session in screen by starting screen as:

    > screen -U -S session_name

    You can then reattach to a session using:

    > screen -R session_name

    or kill/quit a session using:

    > screen -S session_name -X quit

    Hope that helps

  • chip January 9, 2012 at 2:58 am

    @sanjayts: Thank you for responding back. I am very familiar with screen and a good deal of the the things that can can be done with it. My question is a little more out on the edge: I already have 8 separate screen sessions running and I ‘reattach’ to one with the normal method of screen -r <pid>, however, once I have that screen session attached I would like to be able to attach to the other 7 and stack them, much like we would do ctrl+a ‘c’ . In the end ‘gather’ all of these individual sessions and bring them under one roof so I can scroll through them using ctrl+a n or p (and see them listed, etc). Thanks

  • sanjayts January 10, 2012 at 2:03 am

    @chip: Oops, my previous post was actually meant for @Miki but I’ll take a stab at your question.

    AFAIK, there is no way of concatenating multiple screen sessions. Some recommend attaching processes to the new terminal as here http://unix.stackexchange.com/questions/21470/concatenate-two-screen-sessions but I’m not sure if that’s what you want. As a good compromise, tmux allows jumping between sessions using the ‘choose-session’ command which should at least relieve you of detaching and reattaching just to view the contents of a different session. Good luck.

  • Ashton January 23, 2012 at 8:01 am

    Great tutorial, thanks! Screen is awesome.

  • Stefano February 7, 2012 at 12:05 pm

    I can’t reattach a session of another user being root. It’s important for me because I administer a network and often users forget “screen” sessions on the hosts. Is it possible ? Thank you.

  • itchy rat February 8, 2012 at 12:40 pm

    gr8 !!
    Many a time my putty session disconnected during Linux patching. gr8 pain in the…
    This one seems will ease my patching pains.

    Love this one. Thx a lot.

  • convert flac to mp3 February 8, 2012 at 2:11 am

    thank you
    i’ve been having linux screen management problems for a while now,
    maybe your post will help me to figure out some stuff

  • belgotus March 6, 2012 at 2:38 am

    very good howto, go to basics is the best

  • Storm March 25, 2012 at 2:07 am

    Thanks, mate. Great tutorial.

  • Gretta April 3, 2012 at 9:18 am

    Thanks a lot for the tutorial, it was very useful for me since I have only recently switched to Linux… and love it so far. I will keep watching the blog for more helpful updates.

  • Wendy April 23, 2012 at 6:16 am

    Thanks for the great article!
    I was looking to try using Screen on Linux and after reading this piece from you it looks rather simple.

  • Sathishkumar May 8, 2012 at 12:33 pm

    Thanks for the great guide.

  • Nasimuddin Ansari May 8, 2012 at 9:58 am

    Anyone know how to increase max number of window in a single screen session? In my setup, I can open 40 . For 41th window,  getting message “no more windows”.

  • Bibi June 4, 2012 at 11:23 am

    On my Angstrom distribution screen doesn’t seem to remain active when the ssh connection drops (or is exited). screen -ls gives “no sockets”. Any idea’s how to get this working?

  • kk June 6, 2012 at 5:16 am

    i need how to search fields by using shellscript

  • kamal August 24, 2012 at 1:50 am

    Hi, is it possible to display all the sessions in the status bar if we have more that 10 session in a single screen? The issue i see is that when i open more than 13 session the new session are getting hidden not displayed on the hard status bar. we can use ctrl-a w to see the list. I am looking for an option where we can display all the sessions (for example 20 session with tile) some thing like wrap and display the new windows created in the 2nd line on the hard status bar.

  • Erez August 31, 2012 at 12:54 pm

    The name of the software is “GNU Screen”, not “screen” and definitely not “Linux screen”. By calling it that you’re mis-attributing the software and misleading your readers.

  • Shantanu Deshpande November 2, 2012 at 9:44 am

    Thank You so much,

    this article definitely saved several hours …thanks

  • Tomek November 2, 2012 at 9:44 am

    thank you – a really nice introduction! very helpful

  • Joel November 2, 2012 at 7:36 am

    Fantastic tutorial – always knew that this tool existed, but never had a clear guide and path to get into it – going to be using this every day now!

  • KP November 5, 2012 at 11:45 am

    @Jeff – Thank you for your efforts!  Thank you for taking time out of your life to post these write ups.  Though it may be simple… from the remarks that you received after your post, it is evident that you helped people and you were on par covering the need for it. Kudos to you sir!

  • Dave November 27, 2012 at 12:47 pm

    Arghhh…. happily using cygwin and getting kicked off regularly.
    Ran this screen as it is supposed to protect against that and its decided to bugger around with my settings so now I can’t scroll up and down the large screen I happily had…

  • kumaoni November 28, 2012 at 11:29 am

    This tutorial is so cool.. opens a whole new world to managing my linux wiindows, thanks Jeffrey !!

  • Geoffrey Hoffman November 29, 2012 at 1:20 am

    I have to agree with everyone else here. This is a great overview tutorial for newbies like me. I have a feeling I will be back here many times. Bookmarked!

  • Antony February 11, 2013 at 12:28 pm

    No, it’s not GNU. I have the 4th Berkeley distribution, and it’s just called ‘screen’ version 4.0.2. According to the man-page:

    Its roots are a merge of a custom version 2.3PR7 by Wayne Davison and several enhancements to Oliver Laumann’s version 2.0. Note that all versions numbered 2.x are copy-right by Oliver Laumann.

    Nothing to do with GNU.

  • Alex February 27, 2013 at 6:59 am

    Would I be right in assuming that this would not work well for GUI programs?  If I start SSH with the “-X” option and run a remote graphical program, then the program will still die if I should lose my connection, since the X-Windows connection has broken, right?  If not, how would I ever get back to the GUI interface?

  • oddsatisfied March 12, 2013 at 8:37 am

    Nothing like a comment on a five-year-old blog, but I second Matthew’s recommendation for Byobu. It’s in the repos for Debian and is preinstalled in Ubuntu server. A nice feature is automatic start, so once it’s enabled I can just use it without forgetting to launch it.

  • Caz February 11, 2014 at 7:48 am

    I would use screen a lot more if it was not for the Ctrl-A trap. I use Ctrl-A to move the cursor in putty session to the start of the line. However if I have screen running EVERYTHING freezes up. And I have never been able to get out of the frozen state. Thanks to this blog can kill the screen with Ctrl-A k but that is as good as I have managed.

    Could be that I always go to the start of the line to enter ‘sudo’. Just tested. Ctrl-A sudo gets me into dead state. I probably change something on the terminal so I no longer get any feedback but I have no idea how to recover from this other than killing the screen and starting over.

Post a Comment

Your email is kept private. Required fields are marked *