More Tips and Tricks for GNU Screen
Lock, Monitor, Flip, Mirror
- Monitor a window for output: Hit Ctrl-A Shift-M when in window 1, and then flip to window 2 (with Ctrl-A N), and you'll be notified in window 2 when there's output in window 1. This is useful if you're running a job that takes a long time; no need to keep flipping between windows. You can also monitor for silence with Ctrl-A _. This is useful if you're running a compile job or something else that outputs a lot of stuff when it's running successfully.
- Use the window list: Hit Ctrl-A " to see the window list. This is great if you have lots of windows open within screen. To name your windows more helpfully, use Ctrl-A Shift-A while in the window to set its title.
- Mirror another session: Use screen -x to connect to another existing session, and mirror everything that goes on in it. The existing session will also mirror anything that goes on in the second on. I use this when connecting to the server that runs my email from more than one place at once. It can also be useful for debugging - log in as the user that's having problems, and connect to his or her screen session.
- Lock the screen: Hit Ctrl-A X to lock the screen; unlock it using your password.
You can also use the ~/.screenrc file to set persistent options, including to start a set of windows up when screen launches. Check out the manpage and the GNU screen wiki for more.
Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of "Linux System Administration Recipes: A Problem-Solution Approach" (Apress, 2009).
Article courtesy of ServerWatch
- 1Linux Top 3: Fedora 24, Peppermint 7 and Solus 1.2
- 2Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 3Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 4Linux 4.6 Charred Weasel adds USB 3.1 Support
- 5Linux Top 3: OpenIndiana 2016.04, Ubuntu 16.04 and Debian's New Leader