Screen is, in my obviously not so humble opinion (this is my blog as it were), one of the most important tools a Systems Admin can have in their toolkit. As a Systems and Backup administrator I have learned quite a few things over the years, but one of the most important is the screen command (if you don’t have this on your system, see about getting it as soon as possible – sorry it’s GNU so no windows (that I’m currently aware of) get the latest version here. Here are a few of the things that I like and have learned.
Since I tend to do most of my restores from the command line, and some of them can be rather large (yes I know this is subjective – usually between a few GB’s and multi-terabyte), I have learned to always run my restores in a screen session, as if my terminal gets killed / cancelled / blowed up, the restore session continues (I have been bitten by this before, 3TB’s into a restore and my box got b0rked, blargle restore died).
Here are some of the neato things you can do with screen: Basics: In this regard when you see cap C, it stands for the CTRL key. start a new screen session: shell#> screen -S <name> creates a new screen session. Detach from screen session: C - a d (means press CTRL + a (lower case) then d List screen sessions: screen -ls Re-attach to screen session: screen -r pid or screen -r name One of the coolest aspects of screen is the ability to do multiuser sessions. Make screen multiuser: C - a then type : (colon) multiuser on See who is attached to multiuser: C - a * or C - a :display Split the screen: C - a S or C - a :split Switch windows (regions): C - a <Tab> or C - a :focus So when you create a new region it will be blank, you can then type C - a C - c to create a new window, then C - a <Tab> to the new region, then type C - a 1 to switch the new region to window 1 (the one you just created, the first is always 0). Close all other regions: C - a Q or C - a :only
That’s just a small bit of what screen can do, Just go check out the manual, there are lots of things you can do.
Share and enjoy.