A good .screenrc

Working in a terminal can be productive. Using GNU screen you can easily navigate between sessions on multiple remote hosts from a single term. As an added bonus, the sessions will stay running even when you close the master terminal. Next time you login to the host running the master, all your sessions are there just as you left them.

An example is screenshotted below.

screen in putty

.screenrc

To create this copy the following into ~/.screenrc

# www.skankworks.net
# ~/.screenrc
hardstatus on
hardstatus alwayslastline
hardstatus string “%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a ”
startup_message off

Hardstatus

This turns on the hardstatus line at the bottom. Multiple sessions can now be run. The default session is named “0 bash“. Type screen -t root and a new terminal is opened called “1 root“. You can switch between them with keystrokes CTRL-A then n, where n is the session number.

Downloading GNU Screen
User Manual

Cheat Sheet

Sessions can often be locked by inadvertantly typing CTRL-S. To unlock the session type CTRL-Q.


This entry was posted in General IT and tagged , . Bookmark the permalink.