Screen utility is a boon for Windows users logging onto Linux/Unix servers. Most Linux or Unix users work on multiple terminals simultaneously. Setting up multiple terminals (on every login to server) is time consuming. Monitoring output of running processes from a different machine is nightmare.
Screen utility lets do all these:-
  • Run different processes together
  • With one screen session, multiple terminals (called windows within screen) can be kept alive.
  • Move around between windows (within session), allowing copy/paste
  • Start where you logged out
  • Even when you log out of terminal, processes keep running in screen session
  • Same screen session can be opened in shared mode on multiple machines.
  • It can be compared to VNC, difference being it is console based

 
Commands
Initially screen might appear difficult to use, but its worth the wait (just like vi or emacs editor).
Below are a few commonly used commands for a quick start:-
screen: Opens a new screen session
screen -ls: Shows all the open screen sessions
screen -x : <screen number>: Open a screen session in shared mode
screen -dR : Detach and re-attach a screen session
Once a screen session is open using the above commands, following can be used to navigate terminals.
(Read ^- as Control Key + ‘a’ key followed by other key)
^-A : Rename a window
^-c : Open a new window within screen session
^-n : Go to next window
^-p : Go to previous window
^-<terminal number> : Go to a specific window
^-“<terminal number> : Used for double digit window number
^-Esc : Enables scrolling (use arrow keys or pgup and pgdn)
Sample .screenrc
(Put these lines in ~/.screenrc and enjoy)
hardstatus on
hardstatus alwayslastline
hardstatus string “%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a “
Tagged with →  
Share →

One Response to screen utility

  1. Richie Gabor says:

    I really like your writing style, fantastic information, appreciate it for posting : D.

Leave a Reply

Your email address will not be published. Required fields are marked *