Monday, December 5, 2016

Screen - Linux Utility

Screen is an linux utility to do tasks on many terminal, with just one SSH connection to a server.  We can consider it somewhat like the tabs on our browser.

To start Screen

$ screen -S Bala
The word Bala will be attached to this version of screens.  This means to say that I can open another screen which has its one set of tables with another name of Test with the command "screen -S Test"

CTRL+A & press c
To create a new Tab inside the screen
CTRL+A & press n
To switch between the tabs.
CTRL+A & press d
To detach from this screen instance to be reconnected later.
Screen -ls
This can be used to list all screen process like Bala or Test.
Screen -r
This can be used to reattach to the detached screen.
CTRL+A & Shift s
To Split the screen horizontally
CTRL+A & Tab
To move to the split screen.
CTRL+A & press c
To get the prompt here
CTRL+A & Shift x
To remove the split screen.
10        CTRL+A [                              To scroll in the screen and press ESC to get out of copy mode.

Put this in .screenrc

# skip the startup message
startup_message off

# go to home dir

# Automatically detach on hangup. 
autodetach on

# Change default scrollback value for new windows
defscrollback 10000

# start with visual bell as default
vbell on
vbell_msg "bell on %t (%n)"

# look and feel
caption always "%{= bb}%{+b w}%n %t %h %=%l %H %c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

activity "Activity in %t(%n)"

shelltitle "shell"
shell -$SHELL

No comments:

Post a Comment