linux screen keyboard shortcuts

update-notifier-common provides a more efficient and standard mechanism for calculating the number of updates available in the status panel.

Install screen on Ubuntu server

sudo apt-get install screen screen-profiles screen-profiles-extras

This will complete the installation.

Note:- If you are using Jaunty all the above packages already installed in your server

Using Screen

From your ssh login prompt enter the following command

screen

or

screen -S 1

and select your profile option.

 

-S sessionname — When  creating a new session, this option can be used to specify a meaningful name for the session. This name identifies the  session for “screen  -list” and “screen -r” actions.

Once it opens you should see similar to the following screen

Now in this screen we are using top command

If you want to open another session Ctrl + a + c    — Creates a new screen session so that you can use more than one screen session at once.

Once it opens you should see similar to the following screen

If you want to move between windows press CTRL+a followed by   n    key

(first hit CTRL+a, releases both keys and press n).

 

To list all windows use the command CTRL+a followed by ” key

(first hit CTRL+a, releases both keys and press ” ).

 

To switch to window by number use the command CTRL+a followed by ‘ (first hit CTRL+a, releases both keys and press ‘ it will prompt for window number).

 

Ctrl + a   + p — Switches to the previous screen session (if you use more than one).

Ctrl + a  + d — Detaches a screen session (without killing the processes in it — they continue).

To close a screen session where all tasks are finished you can type

exit

If you want to know more available options check screen manpage using

the following command

man screen

 

 

screen –help
Use: screen [-opts] [cmd [args]]
or: screen -r [host.tty]

Options:
-a Force all capabilities into each window’s termcap.
-A -[r|R] Adapt all windows to the new display width & height.
-c file Read configuration file instead of ‘.screenrc’.
-d (-r) Detach the elsewhere running screen (and reattach here).
-dmS name Start as daemon: Screen session in detached mode.
-D (-r) Detach and logout remote (and reattach here).
-D -RR Do whatever is needed to get a screen session.
-e xy Change command characters.
-f Flow control on, -fn = off, -fa = auto.
-h lines Set the size of the scrollback history buffer.
-i Interrupt output sooner when flow control is on.
-l Login mode on (update /var/run/utmp), -ln = off.
-list or -ls. Do nothing, just list our SockDir.
-L Turn on output logging.
-m ignore $STY variable, do create a new screen session.
-O Choose optimal output rather than exact vt100 emulation.
-p window Preselect the named window if it exists.
-q Quiet startup. Exits with non-zero return code if unsuccessful.
-r Reattach to a detached screen process.
-R Reattach if possible, otherwise start a new session.
-s shell Shell to execute rather than $SHELL.
-S sockname Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title Set title. (window’s name).
-T term Use term as $TERM for windows, rather than “screen”.
-U Tell screen to use UTF-8 encoding.
-v Print “Screen version 4.00.03 (FAU) 23-Oct-06”.
-wipe Do nothing, just clean up SockDir.
-x Attach to a not detached screen. (Multi display mode).
-X Execute <cmd> as a screen command in the specified session

 

Customise Screen-profiles

If you look in the bottom right corner you’ll see there’s an “F9 Menu” you can press F9 to reconfigure your screen profiles.Once it opens you should see similar to the following screen here you can see list of changes you can do

Sample screenshots for screen-profile options

source:ubuntugeek.com/screen-manages-multiple-sessions-on-one-terminal.html

 

 

Note for nested screen sessions, use "Ctrl+a a" to send commands to the inner screen,
and the standard "Ctrl+a" to send commands to the outer screen.
Key Action Notes
Ctrl+a c new window
Ctrl+a n next window I bind F12 to this
Ctrl+a p previous window I bind F11 to this
Ctrl+a “ select window from list I have window list in the status line
Ctrl+a Ctrl+a previous window viewed
 
Ctrl+a S split terminal horizontally into regions Ctrl+a c to create new window there
Ctrl+a | split terminal vertically into regions Requires screen >= 4.1
Ctrl+a :resize resize region
Ctrl+a :fit fit screen size to new terminal size Ctrl+a F is the same. Do after resizing xterm
Ctrl+a :remove remove region Ctrl+a X is the same
Ctrl+a tab Move to next region
 
Ctrl+a d detach screen from terminal Start screen with -r option to reattach
Ctrl+a A set window title
Ctrl+a x lock session Enter user password to unlock
Ctrl+a [ enter scrollback/copy mode Enter to start and end copy region. Ctrl+a ] to leave this mode
Ctrl+a ] paste buffer Supports pasting between windows
Ctrl+a > write paste buffer to file useful for copying between screens
Ctrl+a < read paste buffer from file useful for pasting between screens
 
Ctrl+a ? show key bindings/command names Note unbound commands only in man page
Ctrl+a : goto screen command prompt up shows last command entered