My 10 Tips for Using GNU screen to Improve Productivity

People have told me about GNU screen and praised all its glory for a long time, however I never really got it going until now. I guess it might be one of those tools to you grow to use, but after getting the hang of it, I wish I had made the leap much sooner. Take it from me, if you regularly use and connect to multiple terminals, even on the same computer, you should make the mastery of screen a priority. After really sinking my teeth into the program over the last couple of weeks, here’s some things I found very helpful and important to my productivity.

  1. Use it in a full screen terminal. I use Fluxbox and Putty and both enable full screen capabilities.
  2. Spend some extensive time customizing your .screenrc file. I have mine configured to open 3 split regions and define a caption and a hardstatus line. It also adjusts the size of the regions for me and then puts the focus on my preferred region.
  3. Use a hardstatus line that makes sense for your preferred method. In Putty’s full screen mode, it still shows the windows toolbar, so my hardstatus line shows there.
  4. Decide on a split screen interface that makes works with your flow. This might be my best productivity trick, and I’m hoping others can share something that can further refine my technique. I usually work in a split screen interface with 3 regions and connect to three machines. The top region is I usually reserve as a command line for the same workstation that hosts my screen application. This allows me to always be able to easily add new windows to my screen session. My bottom region is usually reserved for an open notes text file. The region between is my “application” area. The top region I use to create “one-off” windows for programs and commands that i don’t care about once they are completed but would like to be able to monitor while it is running, such as the verbose output from an extensive rsync operation.
  5. Learn to use screen’s copy and paste function. When using screen in split screen mode, your terminal program doesnt handle the scrolling for you, so you’ll find it necessary to scroll back in one of those regions and copy and paste some information. Figure it out at your first opportunity and you’ll be satisfied. To get started it’s easy. The copy and paste default keys are logically paired on the keyboard and sensibly located. C-a [ for copy and C-a ] for paste. The first time you press C-a [ you will be able to use the up/down arrows to move the cursor. Move it to the beginning of the region you desire to highlight and then press enter. Then move the cursor using the arrow keys to the end of the region. Again, press enter to copy. Now switch to where you’d like to use the copied text as input, and press C-a ] to paste.
  6. Begin to use multiple sessions. Here’s where you take all of the incredible power of screen, and then multiply everything it does, and it requires no extra learning.
  7. Determine the important parameters for screen and quickly ignore the ones that you don’t find necessary. Some of the command line options look the same as others, especially amongst -d, -D, -R, -r, -RR and the manpage really makes a mockery of anyone trying to understand what the author intended as the differences. I usually rely on -D and -R.
  8. Begin to use multiple configuration files. By using multiple configuration files, you’re able to simply some automation. For example you can have one .screenrc file that manages all of your backup processes and another that handles your general login and system management operations. I also have a configuration file for screen that opens up an entire software development platform for me.
  9. Promptly add bind s on a blank line in the .screenrc file. This will prevent the errant suspension of the output of windows.
  10. Read the gentoo user’s wiki guide to using screen. It has a lot of excellent nuggets of information that are very helpful.

I hope you share some of your favorite tips here.