Tuesday, 26 July 2016

Getting a Team Viewer like experience in UNIX with the screen command

Team Viewer is a very useful utility allowing us to share our computer screens remotely.
Consider a scenario wherein you & a colleague are working in different geographic locations & trying to troubleshoot a scenario or maybe you are trying to provide a knowledge transfer to a junior administrator regarding a task but the junior administrator does not work in the same geographic location as you.

In this situation using the screen command is a good option for you to be able to share your terminal session screen with anyone in real time. Here's how to do it:

Open up two terminal sessions for the same server & get the current shell PIDs.


On one of the terminal windows run the screen command & get the session id with 'screen -ls' command.


Now, attach to this screen on the second terminal session using the session id of the screen obtained from 'screen -ls' command.


That's it. Now any command you run on one terminal will be visible on the other terminal as shown in the below screen shots:


To end the screen sessions press ctrl+d.

The screen command was available out of the box in this Solaris 11 server but may not available in some Linux distributions by default. You can install screen command using a yum repository in case its not available.

No comments:

Post a Comment

Using capture groups in grep in Linux

Introduction Let me start by saying that this article isn't about capture groups in grep per se. What we are going to do here with gr...