Home‎ > ‎unix/linux‎ > ‎

screen

Screen is a great tool to use when working on a ssh console.  It enables you to not have to worry when your remote session is dropped because of a funky wifi or wan link.  It's also nice because you can easily have multiple named windows within the single ssh console, and you can easily log the output to a file.  (IE: setup a long compile on one window, and log the output to a file, then open up another and get some work done.  If your session gets hung, dial back in and reconnect with the remote sessions not knowing any better.)

Things you can do do within screen: 

  1. start screen:  screen
  2. name the session: [Crtl]+a A  {then enter a name}d)
  3. page up or down in your screen window [Ctrl]+a [Exc] {then [Page Up] or [Page Down] as often as you want}
  4. detach from session while keeping it running (maybe a compile is going on?): [Crtl]+a d  {that's "control" and "a" together, then release, and hit "d".}
  5. re-attach (go back) to the original screen: screen -D -R You can use this to reestablish a screen connection if your session gets dropped.  (think vpn session is dropped)
  6. quickly start another session: [Crtl]+a c
  7. name that window[Crtl]+a A  {then enter a name}
  8. get a list of all the windows, and flip between them [Ctrl]+a " {then scroll up/down}
  9. shut down the open window [Ctrl]+a k
  10. tab between sessions [Ctrl]+a [Tab]e
  11. goto 1st (0), 2nd (1), etc screen window  [Ctrl]+a # {where # is 0,1,2...9}
  12. start/stop logging of everything from the screen to file "hardcopy.n" [Ctrl]+a H
  13. quit screen and shutdown all windows [Ctrl]+a [Ctrl]+\


Comments