Friday, April 30, 2010

Screen Utility

Screen utility

-----------------------------------------

Working on a remote server and your coworker wanted you to share and allow control of the shel?l so that it can be a collaborative effort! The UNIX way it would be is GNU Screen.

GNU Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

While you google out the detail, let me quickly put down the working step for the same.

Download

yum screen
chmod u+s /usr/bin/screen
chmod 755 /var/run/screen

Tell you friend to login to the same server which you both wanted to work.
Now once he starts :

At your end,
# open a screen
e.g $screen -S
$ Press Ctrl+a, then type :multiuser on and press Enter.

$ Press Ctrl+a, then type :acladd debu

At the other end, you have to access it like this


login
and
screen -x debu/
Note: I believe your friend is working with login id "debu"

And now you see what he is doing and also enter command if you want. Vitually you guys are working on the same screen.

Complaints :

!/ I was working with a shell, accdently i hit the close button of my shell and all gone
2/ I have started so many things and want to go back home leaving all as it is and just login and start working again.(specially kernel compilation and all)

Solution:
1/ Start work on screen
2/ get the screen id

sreen -ls

3/ detach(mind u not terminate) with ctrl+a + d and go home
4/ connect to screen with the same user

screen -x debu


Next, i wanted to share screens multi window capability which i just loved. It reminded me Linux's multiple pseudo terminal switching cpability on the physical native host, with alt/ctrl/Fn combinations.

The following are the commans/keys lets you navigate through your screen environment. Note that unless modified by your .screenrc, by default every screen shortcut is preceded by Ctrl+a. Note that these shortcuts are case-sensitive.

  • ctrl + a c = new window
  • Ctrl+a n = Switches to the next available window
  • ctrl +a p = previous window.
  • Ctrl+a S = split the terminal horizontally
  • Ctrl+a " = select window from list
  • Backspace – Switches to the previous available
  • Ctrl+a – Switches back to the last window you were on
  • A – Changes window session name
  • K – Kills a window session
  • c – Creates a new window
  • [ - Then use arrows to scroll up and down terminal,
Do see the man page for screen for more $man screen
:-)



~Thanks - Debu

No comments:

Post a Comment

8c tips for Freshers / NCG's

I have been having a great company with some of the very talented NCG’s ( New College Hires/ Grads ) last ~2yrs.  I work for Intuit I...