Thursday 13 January 2011

Screen HowTo Part 2

Linux HowTo's - Advance Linux HowTo's
Written by Allen Sanabria   
Saturday, 17 May 2008 10:39

In the the first part of this HowTo,  I gave you the bare minimum to get Screen working
and how to use it on a day to day basis.... This time around I will show you some
of the advanced features of screen that may make your life easier in the terminal..
Before continuing this HowTo please read Part 1 if you do not have previous experience with screen.
So lets start this HowTo with some more Screen Commands...

 







1- To start a split screen session in you current screen session...
    ((ctrl+a) S
2- To switch between split screens...    ((ctrl+a) )...
3- To copy output from one split screen to the next...
    ((ctrl+a) [) now using the up and down arrow find the output you want to copy and from where you want to start copying hit the and keep using the arrows to where you want to stop copying and hit the  again.
4- To paste the output from the previous command...
    ((ctrl+a) ]) Now if you want to paste it in the split terminal you would have to do step 2 then step 4.
I use the above commands especially to copy output from one terminal to next without a mouse.
5- Now lets say you want to lock our screen session from private eyes...
   ((ctrl+ax)   
To unlock your session just use your password for you account.
The following below will make your screen session show all of your sessions in a nice bar below your terminal, show you the current date and time, as well as tell you the host you are in. Check the screenshot above to see what it would look like.

Add the following below to .screenrc in your home directory..... Example /home/dynasty/.screenrc
hardstatus alwayslastline 
hardstatus string '%{b}[ %{B}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}
(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %m/%d %c ]%{W}'
startup_message off
defscrollback 200000
shelltitle dynasty
caption always

No comments:

Post a Comment