Saturday, July 12, 2008

Screen in Unix

Screen provides multiple window capability in Unix, just like firefox provides you the capabilities of multiple tabs opened at a time
Here is how you can work with screen command

Create a screen by
screen -S "screen name" for creating a screen with name "screen name".

List all screens using
screen -ls for listing all the screens.

To attach a detatched screen
screen -dr "screenName" to attach to a screen.

To share a screen across the users
screen -x "screen name" to share the screen.

CTRL-a is the base command to work with all screen commands in unix.

CTRL-a-c to create a new window in screen

CTRL-a-d to detach from all screens and return to main shell.

CTRL-a-CTRL-a to move back and forward in your multiple windows.

CTRL-a-SHIFT-a to rename your current window.

CTRL-a-k to kill current window.

CTRL-a-SHIFT-" to navigate to all screens in a tabular fashion.

CTRL-a-num to move num window

CTRL-a-n to move to next window

CTRL-a-p to move to previous window

CTRL-a-BACKSPACE to move to previous window

You can also customize how screen window looks like. For that you have to make change to .screenrc file found in your user directory. Insert these lines in .screenrc file to have a nice looking tabs in each of your screen window.

startup_message off
vbell off
caption always "%{= bb}%{+b w}%n %h %=%t %c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
activity "Activity in %t(%n)"
shell -/bin/bash

Sphere: Related Content

0 comments: