Monday, October 8, 2007

One minute Screen Tutorial

For those of you who love the command line screen provides a definitive way of organizing your work into a set detachable console sessions called screens which can be added and removed on demand. This removes the limitation of the number of virtual consoles(tty) you can have. Think of screen as a virtual windowing system for the console. ;o)

$ screen -a -S 'New Screen Session' $ sleep 60 #Press Ctrl+A+D for detaching the screen [detached] $ screen -list Your inventory: 4660.New Screen Session (Detached) 1 Socket in /var/run/screen/S-arky. $ screen -r 4660 $ sleep 60 $ #Press Ctrl+D for terminating the screen [screen is terminating]

Here we first started a new screen and ran a command 'sleep 60' then detached the screen session. Later we listed out (all) the current screens running on this system along with the their process ID's and re-attached our old screen session. Once the sleep command is completed we terminated the session. Also you can try pressing keys for command completion whenever possible.

  • screen -a Starts a new screen, -S add a title to the screen session, you can use either the process ID or the screen title with '-r'
  • screen -list Lists the currents screen sessions
  • screen -r Reattaches a existing screen with the given process ID

2 comments:

You can leave a comment here using your Google account, OpenID or as an anonymous user.

Popular Posts